Skip to content

Commit

Permalink
feat(dnssec)!: move under DNS namespace (#2233)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Dec 3, 2024
1 parent 7d503e6 commit 40cb3e1
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 95 deletions.
28 changes: 14 additions & 14 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,20 @@ Types:
from cloudflare.types.dns import DNSAnalyticsNominalMetric, DNSAnalyticsQuery
```

## DNSSEC

Types:

```python
from cloudflare.types.dns import DNSSEC, DNSSECDeleteResponse
```

Methods:

- <code title="delete /zones/{zone_id}/dnssec">client.dns.dnssec.<a href="./src/cloudflare/resources/dns/dnssec.py">delete</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dns/dnssec_delete_response.py">str</a></code>
- <code title="patch /zones/{zone_id}/dnssec">client.dns.dnssec.<a href="./src/cloudflare/resources/dns/dnssec.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/dnssec_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/dnssec.py">Optional[DNSSEC]</a></code>
- <code title="get /zones/{zone_id}/dnssec">client.dns.dnssec.<a href="./src/cloudflare/resources/dns/dnssec.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dns/dnssec.py">Optional[DNSSEC]</a></code>

## Records

Types:
Expand Down Expand Up @@ -1154,20 +1168,6 @@ Methods:
- <code title="patch /accounts/{account_id}/dns_firewall/{dns_firewall_id}/reverse_dns">client.dns.firewall.reverse_dns.<a href="./src/cloudflare/resources/dns/firewall/reverse_dns.py">edit</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/reverse_dns_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/reverse_dns_edit_response.py">Optional[ReverseDNSEditResponse]</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/reverse_dns">client.dns.firewall.reverse_dns.<a href="./src/cloudflare/resources/dns/firewall/reverse_dns.py">get</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall/reverse_dns_get_response.py">Optional[ReverseDNSGetResponse]</a></code>

# DNSSEC

Types:

```python
from cloudflare.types.dnssec import DNSSEC, DNSSECDeleteResponse
```

Methods:

- <code title="delete /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">delete</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dnssec/dnssec_delete_response.py">str</a></code>
- <code title="patch /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dnssec/dnssec_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">Optional[DNSSEC]</a></code>
- <code title="get /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">Optional[DNSSEC]</a></code>

# EmailSecurity

## Investigate
Expand Down
37 changes: 0 additions & 37 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
rules,
speed,
zones,
dnssec,
images,
queues,
stream,
Expand Down Expand Up @@ -310,12 +309,6 @@ def dns(self) -> dns.DNSResource:

return DNSResource(self)

@cached_property
def dnssec(self) -> dnssec.DNSSECResource:
from .resources.dnssec import DNSSECResource

return DNSSECResource(self)

@cached_property
def email_security(self) -> email_security.EmailSecurityResource:
from .resources.email_security import EmailSecurityResource
Expand Down Expand Up @@ -1075,12 +1068,6 @@ def dns(self) -> dns.AsyncDNSResource:

return AsyncDNSResource(self)

@cached_property
def dnssec(self) -> dnssec.AsyncDNSSECResource:
from .resources.dnssec import AsyncDNSSECResource

return AsyncDNSSECResource(self)

@cached_property
def email_security(self) -> email_security.AsyncEmailSecurityResource:
from .resources.email_security import AsyncEmailSecurityResource
Expand Down Expand Up @@ -1773,12 +1760,6 @@ def dns(self) -> dns.DNSResourceWithRawResponse:

return DNSResourceWithRawResponse(self._client.dns)

@cached_property
def dnssec(self) -> dnssec.DNSSECResourceWithRawResponse:
from .resources.dnssec import DNSSECResourceWithRawResponse

return DNSSECResourceWithRawResponse(self._client.dnssec)

@cached_property
def email_security(self) -> email_security.EmailSecurityResourceWithRawResponse:
from .resources.email_security import EmailSecurityResourceWithRawResponse
Expand Down Expand Up @@ -2292,12 +2273,6 @@ def dns(self) -> dns.AsyncDNSResourceWithRawResponse:

return AsyncDNSResourceWithRawResponse(self._client.dns)

@cached_property
def dnssec(self) -> dnssec.AsyncDNSSECResourceWithRawResponse:
from .resources.dnssec import AsyncDNSSECResourceWithRawResponse

return AsyncDNSSECResourceWithRawResponse(self._client.dnssec)

@cached_property
def email_security(self) -> email_security.AsyncEmailSecurityResourceWithRawResponse:
from .resources.email_security import AsyncEmailSecurityResourceWithRawResponse
Expand Down Expand Up @@ -2811,12 +2786,6 @@ def dns(self) -> dns.DNSResourceWithStreamingResponse:

return DNSResourceWithStreamingResponse(self._client.dns)

@cached_property
def dnssec(self) -> dnssec.DNSSECResourceWithStreamingResponse:
from .resources.dnssec import DNSSECResourceWithStreamingResponse

return DNSSECResourceWithStreamingResponse(self._client.dnssec)

@cached_property
def email_security(self) -> email_security.EmailSecurityResourceWithStreamingResponse:
from .resources.email_security import EmailSecurityResourceWithStreamingResponse
Expand Down Expand Up @@ -3332,12 +3301,6 @@ def dns(self) -> dns.AsyncDNSResourceWithStreamingResponse:

return AsyncDNSResourceWithStreamingResponse(self._client.dns)

@cached_property
def dnssec(self) -> dnssec.AsyncDNSSECResourceWithStreamingResponse:
from .resources.dnssec import AsyncDNSSECResourceWithStreamingResponse

return AsyncDNSSECResourceWithStreamingResponse(self._client.dnssec)

@cached_property
def email_security(self) -> email_security.AsyncEmailSecurityResourceWithStreamingResponse:
from .resources.email_security import AsyncEmailSecurityResourceWithStreamingResponse
Expand Down
14 changes: 14 additions & 0 deletions src/cloudflare/resources/dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
DNSResourceWithStreamingResponse,
AsyncDNSResourceWithStreamingResponse,
)
from .dnssec import (
DNSSECResource,
AsyncDNSSECResource,
DNSSECResourceWithRawResponse,
AsyncDNSSECResourceWithRawResponse,
DNSSECResourceWithStreamingResponse,
AsyncDNSSECResourceWithStreamingResponse,
)
from .records import (
RecordsResource,
AsyncRecordsResource,
Expand Down Expand Up @@ -42,6 +50,12 @@
)

__all__ = [
"DNSSECResource",
"AsyncDNSSECResource",
"DNSSECResourceWithRawResponse",
"AsyncDNSSECResourceWithRawResponse",
"DNSSECResourceWithStreamingResponse",
"AsyncDNSSECResourceWithStreamingResponse",
"RecordsResource",
"AsyncRecordsResource",
"RecordsResourceWithRawResponse",
Expand Down
32 changes: 32 additions & 0 deletions src/cloudflare/resources/dns/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

from __future__ import annotations

from .dnssec import (
DNSSECResource,
AsyncDNSSECResource,
DNSSECResourceWithRawResponse,
AsyncDNSSECResourceWithRawResponse,
DNSSECResourceWithStreamingResponse,
AsyncDNSSECResourceWithStreamingResponse,
)
from .records import (
RecordsResource,
AsyncRecordsResource,
Expand Down Expand Up @@ -44,6 +52,10 @@


class DNSResource(SyncAPIResource):
@cached_property
def dnssec(self) -> DNSSECResource:
return DNSSECResource(self._client)

@cached_property
def records(self) -> RecordsResource:
return RecordsResource(self._client)
Expand Down Expand Up @@ -81,6 +93,10 @@ def with_streaming_response(self) -> DNSResourceWithStreamingResponse:


class AsyncDNSResource(AsyncAPIResource):
@cached_property
def dnssec(self) -> AsyncDNSSECResource:
return AsyncDNSSECResource(self._client)

@cached_property
def records(self) -> AsyncRecordsResource:
return AsyncRecordsResource(self._client)
Expand Down Expand Up @@ -121,6 +137,10 @@ class DNSResourceWithRawResponse:
def __init__(self, dns: DNSResource) -> None:
self._dns = dns

@cached_property
def dnssec(self) -> DNSSECResourceWithRawResponse:
return DNSSECResourceWithRawResponse(self._dns.dnssec)

@cached_property
def records(self) -> RecordsResourceWithRawResponse:
return RecordsResourceWithRawResponse(self._dns.records)
Expand All @@ -142,6 +162,10 @@ class AsyncDNSResourceWithRawResponse:
def __init__(self, dns: AsyncDNSResource) -> None:
self._dns = dns

@cached_property
def dnssec(self) -> AsyncDNSSECResourceWithRawResponse:
return AsyncDNSSECResourceWithRawResponse(self._dns.dnssec)

@cached_property
def records(self) -> AsyncRecordsResourceWithRawResponse:
return AsyncRecordsResourceWithRawResponse(self._dns.records)
Expand All @@ -163,6 +187,10 @@ class DNSResourceWithStreamingResponse:
def __init__(self, dns: DNSResource) -> None:
self._dns = dns

@cached_property
def dnssec(self) -> DNSSECResourceWithStreamingResponse:
return DNSSECResourceWithStreamingResponse(self._dns.dnssec)

@cached_property
def records(self) -> RecordsResourceWithStreamingResponse:
return RecordsResourceWithStreamingResponse(self._dns.records)
Expand All @@ -184,6 +212,10 @@ class AsyncDNSResourceWithStreamingResponse:
def __init__(self, dns: AsyncDNSResource) -> None:
self._dns = dns

@cached_property
def dnssec(self) -> AsyncDNSSECResourceWithStreamingResponse:
return AsyncDNSSECResourceWithStreamingResponse(self._dns.dnssec)

@cached_property
def records(self) -> AsyncRecordsResourceWithStreamingResponse:
return AsyncRecordsResourceWithStreamingResponse(self._dns.records)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@

import httpx

from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import (
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
async_maybe_transform,
)
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._wrappers import ResultWrapper
from .._base_client import make_request_options
from ..types.dnssec import dnssec_edit_params
from ..types.dnssec.dnssec import DNSSEC
from ..types.dnssec.dnssec_delete_response import DNSSECDeleteResponse
from ..._wrappers import ResultWrapper
from ...types.dns import dnssec_edit_params
from ..._base_client import make_request_options
from ...types.dns.dnssec import DNSSEC
from ...types.dns.dnssec_delete_response import DNSSECDeleteResponse

__all__ = ["DNSSECResource", "AsyncDNSSECResource"]

Expand Down
3 changes: 3 additions & 0 deletions src/cloudflare/types/dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from .dnssec import DNSSEC as DNSSEC
from .a_record import ARecord as ARecord
from .ds_record import DSRecord as DSRecord
from .mx_record import MXRecord as MXRecord
Expand Down Expand Up @@ -42,6 +43,7 @@
from .svcb_record_param import SVCBRecordParam as SVCBRecordParam
from .tlsa_record_param import TLSARecordParam as TLSARecordParam
from .cname_record_param import CNAMERecordParam as CNAMERecordParam
from .dnssec_edit_params import DNSSECEditParams as DNSSECEditParams
from .https_record_param import HTTPSRecordParam as HTTPSRecordParam
from .naptr_record_param import NAPTRRecordParam as NAPTRRecordParam
from .record_edit_params import RecordEditParams as RecordEditParams
Expand All @@ -67,6 +69,7 @@
from .record_batch_response import RecordBatchResponse as RecordBatchResponse
from .record_process_timing import RecordProcessTiming as RecordProcessTiming
from .setting_edit_response import SettingEditResponse as SettingEditResponse
from .dnssec_delete_response import DNSSECDeleteResponse as DNSSECDeleteResponse
from .firewall_create_params import FirewallCreateParams as FirewallCreateParams
from .firewall_edit_response import FirewallEditResponse as FirewallEditResponse
from .firewall_list_response import FirewallListResponse as FirewallListResponse
Expand Down
File renamed without changes.
7 changes: 0 additions & 7 deletions src/cloudflare/types/dnssec/__init__.py

This file was deleted.

Loading

0 comments on commit 40cb3e1

Please sign in to comment.