diff options
| author | 2024-11-20 01:17:40 -0500 | |
|---|---|---|
| committer | 2024-11-20 01:17:40 -0500 | |
| commit | 3e3ebe586385a83b10c8f1d0b9ba9b67c8b56d2f (patch) | |
| tree | 5682f748fc9867166043734aad44e1734d16abeb /pkb_client/client/forwarding.py | |
| parent | fa197fe27b8a03bbf4504476f842956ece2c76c9 (diff) | |
New upstream version 2.0.0.upstream/2.0.0
Diffstat (limited to 'pkb_client/client/forwarding.py')
| -rw-r--r-- | pkb_client/client/forwarding.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkb_client/client/forwarding.py b/pkb_client/client/forwarding.py new file mode 100644 index 0000000..64962ca --- /dev/null +++ b/pkb_client/client/forwarding.py @@ -0,0 +1,28 @@ +from dataclasses import dataclass +from enum import Enum + + +class URLForwardingType(str, Enum): + temporary = "temporary" + permanent = "permanent" + + +@dataclass +class URLForwarding: + id: str + subdomain: str + location: str + type: URLForwardingType + include_path: bool + wildcard: bool + + @staticmethod + def from_dict(d): + return URLForwarding( + id=d["id"], + subdomain=d["subdomain"], + location=d["location"], + type=URLForwardingType[d["type"]], + include_path=d["includePath"] == "yes", + wildcard=d["wildcard"] == "yes", + ) |
