From 3e3ebe586385a83b10c8f1d0b9ba9b67c8b56d2f Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 20 Nov 2024 01:17:40 -0500 Subject: New upstream version 2.0.0. --- pkb_client/client/forwarding.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkb_client/client/forwarding.py (limited to 'pkb_client/client/forwarding.py') 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", + ) -- cgit v1.2.3