cloudfloordns.client

 1from . import sync
 2from .sync import (
 3    Client,
 4    client,
 5    domain,
 6    groups,
 7    record,
 8    zone,
 9)
10
11__all__ = [
12    "client",
13    "domain",
14    "groups",
15    "record",
16    "zone",
17    "Client",
18    "sync",
19]
class Client(cloudfloordns.client.sync.client.BaseClient):
145class Client(BaseClient):
146    records: Records
147    zones: Zones
148    domains: Domains
149    groups: Groups
150
151    def __init__(
152        self, username=None, apikey=None, url=DEFAULT_BASE_URL, throttling=True
153    ) -> None:
154        super().__init__(
155            username=username, apikey=apikey, url=url, throttling=throttling
156        )
157        self.records = Records(self)
158        self.zones = Zones(self)
159        self.domains = Domains(self)
160        self.groups = Groups(self)
161
162    # @property
163    # def domains(self) -> Zones:
164    #     logging.warning(f"Attribute 'domains' in class '{Client}' is deprecated. Use 'zones' instead")
165    #     return self.zones
166
167    def yield_all_domains_records(self) -> Iterable[Tuple[Zone, List[Record]]]:
168        domains = self.zones.list()
169        for d in domains:
170            records = self.records.list(d.domainname)
171            yield d, records
172
173    def all_domains_records(self) -> Dict[Zone, List[Record]]:
174        return dict(self.yield_all_domains_records())
Client( username=None, apikey=None, url='https://apiv3.mtgsy.net/api/v1', throttling=True)
151    def __init__(
152        self, username=None, apikey=None, url=DEFAULT_BASE_URL, throttling=True
153    ) -> None:
154        super().__init__(
155            username=username, apikey=apikey, url=url, throttling=throttling
156        )
157        self.records = Records(self)
158        self.zones = Zones(self)
159        self.domains = Domains(self)
160        self.groups = Groups(self)
def yield_all_domains_records( self) -> Iterable[Tuple[cloudfloordns.models.zone.Zone, List[cloudfloordns.models.record.Record]]]:
167    def yield_all_domains_records(self) -> Iterable[Tuple[Zone, List[Record]]]:
168        domains = self.zones.list()
169        for d in domains:
170            records = self.records.list(d.domainname)
171            yield d, records
def all_domains_records( self) -> Dict[cloudfloordns.models.zone.Zone, List[cloudfloordns.models.record.Record]]:
173    def all_domains_records(self) -> Dict[Zone, List[Record]]:
174        return dict(self.yield_all_domains_records())