summaryrefslogtreecommitdiffstats
path: root/pkb_client/client/forwarding.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-11-20 01:17:41 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2024-11-20 01:17:41 -0500
commiteab0e07b2d9931aa35f243fd24c42c02a4ec8533 (patch)
tree767a0da67d0a1cd8ce30db0ad0c800e17380b4cf /pkb_client/client/forwarding.py
parent6094eb734bfd2159d81ffea918ea5d31e1e61441 (diff)
parent3e3ebe586385a83b10c8f1d0b9ba9b67c8b56d2f (diff)
Update upstream source from tag 'upstream/2.0.0'
Update to upstream version '2.0.0' with Debian dir a538d4b69c2b9e7ec310387046aa40f0e2499b5f
Diffstat (limited to 'pkb_client/client/forwarding.py')
-rw-r--r--pkb_client/client/forwarding.py28
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",
+ )