Skip to content

Commit 1260f11

Browse files
feat: feat(api): add tenant custom nameservers resource mapping
* feat(api): add tenant custom nameservers resource mapping Add Stainless config for tenant-level custom nameserver endpoints: - get /tenants/{tenant_tag}/custom_ns - create (post) /tenants/{tenant_tag}/custom_ns - delete /tenants/{tenant_tag}/custom_ns/{custom_ns_id} Ref: DNS-12922
1 parent 5fe06d2 commit 1260f11

13 files changed

Lines changed: 931 additions & 3 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 2304
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-b841673c088e755bc04d2a0852e97ef3bb7d3c60d13bf9c0ac6f631d38fa5e5b.yml
1+
configured_endpoints: 2307
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-9fa4850bc518b2b2df92fd1a692d888e578a741f6460535bf171c94d64522f83.yml
33
openapi_spec_hash: d9813b2d4243b7d9fa43c5c9e8bc996f
4-
config_hash: bbf9427136a35ea3704b605309480336
4+
config_hash: aed7aa51410f7a92236320eb8c9040f1

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ from cloudflare.types import (
6565

6666
# [CustomNameservers](src/cloudflare/resources/custom_nameservers/api.md)
6767

68+
# [TenantCustomNameservers](src/cloudflare/resources/tenant_custom_nameservers/api.md)
69+
6870
# [DNSFirewall](src/cloudflare/resources/dns_firewall/api.md)
6971

7072
# [DNS](src/cloudflare/resources/dns/api.md)

src/cloudflare/_client.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
certificate_authorities,
148148
leaked_credential_checks,
149149
magic_network_monitoring,
150+
tenant_custom_nameservers,
150151
origin_post_quantum_encryption,
151152
)
152153
from .resources.ai.ai import AIResource, AsyncAIResource
@@ -300,6 +301,10 @@
300301
MagicNetworkMonitoringResource,
301302
AsyncMagicNetworkMonitoringResource,
302303
)
304+
from .resources.tenant_custom_nameservers.tenant_custom_nameservers import (
305+
TenantCustomNameserversResource,
306+
AsyncTenantCustomNameserversResource,
307+
)
303308
from .resources.origin_post_quantum_encryption.origin_post_quantum_encryption import (
304309
OriginPostQuantumEncryptionResource,
305310
AsyncOriginPostQuantumEncryptionResource,
@@ -511,6 +516,12 @@ def custom_nameservers(self) -> CustomNameserversResource:
511516

512517
return CustomNameserversResource(self)
513518

519+
@cached_property
520+
def tenant_custom_nameservers(self) -> TenantCustomNameserversResource:
521+
from .resources.tenant_custom_nameservers import TenantCustomNameserversResource
522+
523+
return TenantCustomNameserversResource(self)
524+
514525
@cached_property
515526
def dns_firewall(self) -> DNSFirewallResource:
516527
from .resources.dns_firewall import DNSFirewallResource
@@ -1433,6 +1444,12 @@ def custom_nameservers(self) -> AsyncCustomNameserversResource:
14331444

14341445
return AsyncCustomNameserversResource(self)
14351446

1447+
@cached_property
1448+
def tenant_custom_nameservers(self) -> AsyncTenantCustomNameserversResource:
1449+
from .resources.tenant_custom_nameservers import AsyncTenantCustomNameserversResource
1450+
1451+
return AsyncTenantCustomNameserversResource(self)
1452+
14361453
@cached_property
14371454
def dns_firewall(self) -> AsyncDNSFirewallResource:
14381455
from .resources.dns_firewall import AsyncDNSFirewallResource
@@ -2275,6 +2292,12 @@ def custom_nameservers(self) -> custom_nameservers.CustomNameserversResourceWith
22752292

22762293
return CustomNameserversResourceWithRawResponse(self._client.custom_nameservers)
22772294

2295+
@cached_property
2296+
def tenant_custom_nameservers(self) -> tenant_custom_nameservers.TenantCustomNameserversResourceWithRawResponse:
2297+
from .resources.tenant_custom_nameservers import TenantCustomNameserversResourceWithRawResponse
2298+
2299+
return TenantCustomNameserversResourceWithRawResponse(self._client.tenant_custom_nameservers)
2300+
22782301
@cached_property
22792302
def dns_firewall(self) -> dns_firewall.DNSFirewallResourceWithRawResponse:
22802303
from .resources.dns_firewall import DNSFirewallResourceWithRawResponse
@@ -2944,6 +2967,14 @@ def custom_nameservers(self) -> custom_nameservers.AsyncCustomNameserversResourc
29442967

29452968
return AsyncCustomNameserversResourceWithRawResponse(self._client.custom_nameservers)
29462969

2970+
@cached_property
2971+
def tenant_custom_nameservers(
2972+
self,
2973+
) -> tenant_custom_nameservers.AsyncTenantCustomNameserversResourceWithRawResponse:
2974+
from .resources.tenant_custom_nameservers import AsyncTenantCustomNameserversResourceWithRawResponse
2975+
2976+
return AsyncTenantCustomNameserversResourceWithRawResponse(self._client.tenant_custom_nameservers)
2977+
29472978
@cached_property
29482979
def dns_firewall(self) -> dns_firewall.AsyncDNSFirewallResourceWithRawResponse:
29492980
from .resources.dns_firewall import AsyncDNSFirewallResourceWithRawResponse
@@ -3613,6 +3644,14 @@ def custom_nameservers(self) -> custom_nameservers.CustomNameserversResourceWith
36133644

36143645
return CustomNameserversResourceWithStreamingResponse(self._client.custom_nameservers)
36153646

3647+
@cached_property
3648+
def tenant_custom_nameservers(
3649+
self,
3650+
) -> tenant_custom_nameservers.TenantCustomNameserversResourceWithStreamingResponse:
3651+
from .resources.tenant_custom_nameservers import TenantCustomNameserversResourceWithStreamingResponse
3652+
3653+
return TenantCustomNameserversResourceWithStreamingResponse(self._client.tenant_custom_nameservers)
3654+
36163655
@cached_property
36173656
def dns_firewall(self) -> dns_firewall.DNSFirewallResourceWithStreamingResponse:
36183657
from .resources.dns_firewall import DNSFirewallResourceWithStreamingResponse
@@ -4284,6 +4323,14 @@ def custom_nameservers(self) -> custom_nameservers.AsyncCustomNameserversResourc
42844323

42854324
return AsyncCustomNameserversResourceWithStreamingResponse(self._client.custom_nameservers)
42864325

4326+
@cached_property
4327+
def tenant_custom_nameservers(
4328+
self,
4329+
) -> tenant_custom_nameservers.AsyncTenantCustomNameserversResourceWithStreamingResponse:
4330+
from .resources.tenant_custom_nameservers import AsyncTenantCustomNameserversResourceWithStreamingResponse
4331+
4332+
return AsyncTenantCustomNameserversResourceWithStreamingResponse(self._client.tenant_custom_nameservers)
4333+
42874334
@cached_property
42884335
def dns_firewall(self) -> dns_firewall.AsyncDNSFirewallResourceWithStreamingResponse:
42894336
from .resources.dns_firewall import AsyncDNSFirewallResourceWithStreamingResponse
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .tenant_custom_nameservers import (
4+
TenantCustomNameserversResource,
5+
AsyncTenantCustomNameserversResource,
6+
TenantCustomNameserversResourceWithRawResponse,
7+
AsyncTenantCustomNameserversResourceWithRawResponse,
8+
TenantCustomNameserversResourceWithStreamingResponse,
9+
AsyncTenantCustomNameserversResourceWithStreamingResponse,
10+
)
11+
12+
__all__ = [
13+
"TenantCustomNameserversResource",
14+
"AsyncTenantCustomNameserversResource",
15+
"TenantCustomNameserversResourceWithRawResponse",
16+
"AsyncTenantCustomNameserversResourceWithRawResponse",
17+
"TenantCustomNameserversResourceWithStreamingResponse",
18+
"AsyncTenantCustomNameserversResourceWithStreamingResponse",
19+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# TenantCustomNameservers
2+
3+
Types:
4+
5+
```python
6+
from cloudflare.types.tenant_custom_nameservers import (
7+
TenantCustomNameserverCreateResponse,
8+
TenantCustomNameserverDeleteResponse,
9+
TenantCustomNameserverGetResponse,
10+
)
11+
```
12+
13+
Methods:
14+
15+
- <code title="post /tenants/{tenant_tag}/custom_ns">client.tenant_custom_nameservers.<a href="./src/cloudflare/resources/tenant_custom_nameservers/tenant_custom_nameservers.py">create</a>(tenant_tag, \*\*<a href="src/cloudflare/types/tenant_custom_nameservers/tenant_custom_nameserver_create_params.py">params</a>) -> <a href="./src/cloudflare/types/tenant_custom_nameservers/tenant_custom_nameserver_create_response.py">Optional[TenantCustomNameserverCreateResponse]</a></code>
16+
- <code title="delete /tenants/{tenant_tag}/custom_ns/{custom_ns_id}">client.tenant_custom_nameservers.<a href="./src/cloudflare/resources/tenant_custom_nameservers/tenant_custom_nameservers.py">delete</a>(custom_ns_id, \*, tenant_tag) -> <a href="./src/cloudflare/types/tenant_custom_nameservers/tenant_custom_nameserver_delete_response.py">SyncSinglePage[TenantCustomNameserverDeleteResponse]</a></code>
17+
- <code title="get /tenants/{tenant_tag}/custom_ns">client.tenant_custom_nameservers.<a href="./src/cloudflare/resources/tenant_custom_nameservers/tenant_custom_nameservers.py">get</a>(tenant_tag) -> <a href="./src/cloudflare/types/tenant_custom_nameservers/tenant_custom_nameserver_get_response.py">SyncSinglePage[TenantCustomNameserverGetResponse]</a></code>

0 commit comments

Comments
 (0)