Skip to content

Commit b9a842b

Browse files
feat(addressing)!: move service bindings to dedicated namespace (#2303)
1 parent df84d3a commit b9a842b

File tree

12 files changed

+214
-211
lines changed

12 files changed

+214
-211
lines changed

api.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -3242,22 +3242,22 @@ Methods:
32423242
- <code title="patch /accounts/{account_id}/addressing/prefixes/{prefix_id}">client.addressing.prefixes.<a href="./src/cloudflare/resources/addressing/prefixes/prefixes.py">edit</a>(prefix_id, \*, account_id, \*\*<a href="src/cloudflare/types/addressing/prefix_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/addressing/prefix.py">Optional[Prefix]</a></code>
32433243
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}">client.addressing.prefixes.<a href="./src/cloudflare/resources/addressing/prefixes/prefixes.py">get</a>(prefix_id, \*, account_id) -> <a href="./src/cloudflare/types/addressing/prefix.py">Optional[Prefix]</a></code>
32443244

3245-
### BGP
3246-
3247-
#### Bindings
3245+
### ServiceBindings
32483246

32493247
Types:
32503248

32513249
```python
3252-
from cloudflare.types.addressing.prefixes.bgp import ServiceBinding, BindingDeleteResponse
3250+
from cloudflare.types.addressing.prefixes import ServiceBinding, ServiceBindingDeleteResponse
32533251
```
32543252

32553253
Methods:
32563254

3257-
- <code title="post /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings">client.addressing.prefixes.bgp.bindings.<a href="./src/cloudflare/resources/addressing/prefixes/bgp/bindings.py">create</a>(prefix_id, \*, account_id, \*\*<a href="src/cloudflare/types/addressing/prefixes/bgp/binding_create_params.py">params</a>) -> <a href="./src/cloudflare/types/addressing/prefixes/bgp/service_binding.py">Optional[ServiceBinding]</a></code>
3258-
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings">client.addressing.prefixes.bgp.bindings.<a href="./src/cloudflare/resources/addressing/prefixes/bgp/bindings.py">list</a>(prefix_id, \*, account_id) -> <a href="./src/cloudflare/types/addressing/prefixes/bgp/service_binding.py">SyncSinglePage[ServiceBinding]</a></code>
3259-
- <code title="delete /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}">client.addressing.prefixes.bgp.bindings.<a href="./src/cloudflare/resources/addressing/prefixes/bgp/bindings.py">delete</a>(binding_id, \*, account_id, prefix_id) -> <a href="./src/cloudflare/types/addressing/prefixes/bgp/binding_delete_response.py">BindingDeleteResponse</a></code>
3260-
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}">client.addressing.prefixes.bgp.bindings.<a href="./src/cloudflare/resources/addressing/prefixes/bgp/bindings.py">get</a>(binding_id, \*, account_id, prefix_id) -> <a href="./src/cloudflare/types/addressing/prefixes/bgp/service_binding.py">Optional[ServiceBinding]</a></code>
3255+
- <code title="post /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings">client.addressing.prefixes.service_bindings.<a href="./src/cloudflare/resources/addressing/prefixes/service_bindings.py">create</a>(prefix_id, \*, account_id, \*\*<a href="src/cloudflare/types/addressing/prefixes/service_binding_create_params.py">params</a>) -> <a href="./src/cloudflare/types/addressing/prefixes/service_binding.py">Optional[ServiceBinding]</a></code>
3256+
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings">client.addressing.prefixes.service_bindings.<a href="./src/cloudflare/resources/addressing/prefixes/service_bindings.py">list</a>(prefix_id, \*, account_id) -> <a href="./src/cloudflare/types/addressing/prefixes/service_binding.py">SyncSinglePage[ServiceBinding]</a></code>
3257+
- <code title="delete /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}">client.addressing.prefixes.service_bindings.<a href="./src/cloudflare/resources/addressing/prefixes/service_bindings.py">delete</a>(binding_id, \*, account_id, prefix_id) -> <a href="./src/cloudflare/types/addressing/prefixes/service_binding_delete_response.py">ServiceBindingDeleteResponse</a></code>
3258+
- <code title="get /accounts/{account_id}/addressing/prefixes/{prefix_id}/bindings/{binding_id}">client.addressing.prefixes.service_bindings.<a href="./src/cloudflare/resources/addressing/prefixes/service_bindings.py">get</a>(binding_id, \*, account_id, prefix_id) -> <a href="./src/cloudflare/types/addressing/prefixes/service_binding.py">Optional[ServiceBinding]</a></code>
3259+
3260+
### BGP
32613261

32623262
#### Prefixes
32633263

src/cloudflare/resources/addressing/prefixes/__init__.py

+14
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,22 @@
2424
DelegationsResourceWithStreamingResponse,
2525
AsyncDelegationsResourceWithStreamingResponse,
2626
)
27+
from .service_bindings import (
28+
ServiceBindingsResource,
29+
AsyncServiceBindingsResource,
30+
ServiceBindingsResourceWithRawResponse,
31+
AsyncServiceBindingsResourceWithRawResponse,
32+
ServiceBindingsResourceWithStreamingResponse,
33+
AsyncServiceBindingsResourceWithStreamingResponse,
34+
)
2735

2836
__all__ = [
37+
"ServiceBindingsResource",
38+
"AsyncServiceBindingsResource",
39+
"ServiceBindingsResourceWithRawResponse",
40+
"AsyncServiceBindingsResourceWithRawResponse",
41+
"ServiceBindingsResourceWithStreamingResponse",
42+
"AsyncServiceBindingsResourceWithStreamingResponse",
2943
"BGPResource",
3044
"AsyncBGPResource",
3145
"BGPResourceWithRawResponse",

src/cloudflare/resources/addressing/prefixes/bgp/__init__.py

-14
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
BGPResourceWithStreamingResponse,
99
AsyncBGPResourceWithStreamingResponse,
1010
)
11-
from .bindings import (
12-
BindingsResource,
13-
AsyncBindingsResource,
14-
BindingsResourceWithRawResponse,
15-
AsyncBindingsResourceWithRawResponse,
16-
BindingsResourceWithStreamingResponse,
17-
AsyncBindingsResourceWithStreamingResponse,
18-
)
1911
from .prefixes import (
2012
PrefixesResource,
2113
AsyncPrefixesResource,
@@ -34,12 +26,6 @@
3426
)
3527

3628
__all__ = [
37-
"BindingsResource",
38-
"AsyncBindingsResource",
39-
"BindingsResourceWithRawResponse",
40-
"AsyncBindingsResourceWithRawResponse",
41-
"BindingsResourceWithStreamingResponse",
42-
"AsyncBindingsResourceWithStreamingResponse",
4329
"PrefixesResource",
4430
"AsyncPrefixesResource",
4531
"PrefixesResourceWithRawResponse",

src/cloudflare/resources/addressing/prefixes/bgp/bgp.py

-32
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
from __future__ import annotations
44

5-
from .bindings import (
6-
BindingsResource,
7-
AsyncBindingsResource,
8-
BindingsResourceWithRawResponse,
9-
AsyncBindingsResourceWithRawResponse,
10-
BindingsResourceWithStreamingResponse,
11-
AsyncBindingsResourceWithStreamingResponse,
12-
)
135
from .prefixes import (
146
PrefixesResource,
157
AsyncPrefixesResource,
@@ -33,10 +25,6 @@
3325

3426

3527
class BGPResource(SyncAPIResource):
36-
@cached_property
37-
def bindings(self) -> BindingsResource:
38-
return BindingsResource(self._client)
39-
4028
@cached_property
4129
def prefixes(self) -> PrefixesResource:
4230
return PrefixesResource(self._client)
@@ -66,10 +54,6 @@ def with_streaming_response(self) -> BGPResourceWithStreamingResponse:
6654

6755

6856
class AsyncBGPResource(AsyncAPIResource):
69-
@cached_property
70-
def bindings(self) -> AsyncBindingsResource:
71-
return AsyncBindingsResource(self._client)
72-
7357
@cached_property
7458
def prefixes(self) -> AsyncPrefixesResource:
7559
return AsyncPrefixesResource(self._client)
@@ -102,10 +86,6 @@ class BGPResourceWithRawResponse:
10286
def __init__(self, bgp: BGPResource) -> None:
10387
self._bgp = bgp
10488

105-
@cached_property
106-
def bindings(self) -> BindingsResourceWithRawResponse:
107-
return BindingsResourceWithRawResponse(self._bgp.bindings)
108-
10989
@cached_property
11090
def prefixes(self) -> PrefixesResourceWithRawResponse:
11191
return PrefixesResourceWithRawResponse(self._bgp.prefixes)
@@ -119,10 +99,6 @@ class AsyncBGPResourceWithRawResponse:
11999
def __init__(self, bgp: AsyncBGPResource) -> None:
120100
self._bgp = bgp
121101

122-
@cached_property
123-
def bindings(self) -> AsyncBindingsResourceWithRawResponse:
124-
return AsyncBindingsResourceWithRawResponse(self._bgp.bindings)
125-
126102
@cached_property
127103
def prefixes(self) -> AsyncPrefixesResourceWithRawResponse:
128104
return AsyncPrefixesResourceWithRawResponse(self._bgp.prefixes)
@@ -136,10 +112,6 @@ class BGPResourceWithStreamingResponse:
136112
def __init__(self, bgp: BGPResource) -> None:
137113
self._bgp = bgp
138114

139-
@cached_property
140-
def bindings(self) -> BindingsResourceWithStreamingResponse:
141-
return BindingsResourceWithStreamingResponse(self._bgp.bindings)
142-
143115
@cached_property
144116
def prefixes(self) -> PrefixesResourceWithStreamingResponse:
145117
return PrefixesResourceWithStreamingResponse(self._bgp.prefixes)
@@ -153,10 +125,6 @@ class AsyncBGPResourceWithStreamingResponse:
153125
def __init__(self, bgp: AsyncBGPResource) -> None:
154126
self._bgp = bgp
155127

156-
@cached_property
157-
def bindings(self) -> AsyncBindingsResourceWithStreamingResponse:
158-
return AsyncBindingsResourceWithStreamingResponse(self._bgp.bindings)
159-
160128
@cached_property
161129
def prefixes(self) -> AsyncPrefixesResourceWithStreamingResponse:
162130
return AsyncPrefixesResourceWithStreamingResponse(self._bgp.prefixes)

src/cloudflare/resources/addressing/prefixes/prefixes.py

+32
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
from ...._wrappers import ResultWrapper
3939
from ....pagination import SyncSinglePage, AsyncSinglePage
4040
from ...._base_client import AsyncPaginator, make_request_options
41+
from .service_bindings import (
42+
ServiceBindingsResource,
43+
AsyncServiceBindingsResource,
44+
ServiceBindingsResourceWithRawResponse,
45+
AsyncServiceBindingsResourceWithRawResponse,
46+
ServiceBindingsResourceWithStreamingResponse,
47+
AsyncServiceBindingsResourceWithStreamingResponse,
48+
)
4149
from ....types.addressing import prefix_edit_params, prefix_create_params
4250
from ....types.addressing.prefix import Prefix
4351
from ....types.addressing.prefix_delete_response import PrefixDeleteResponse
@@ -46,6 +54,10 @@
4654

4755

4856
class PrefixesResource(SyncAPIResource):
57+
@cached_property
58+
def service_bindings(self) -> ServiceBindingsResource:
59+
return ServiceBindingsResource(self._client)
60+
4961
@cached_property
5062
def bgp(self) -> BGPResource:
5163
return BGPResource(self._client)
@@ -299,6 +311,10 @@ def get(
299311

300312

301313
class AsyncPrefixesResource(AsyncAPIResource):
314+
@cached_property
315+
def service_bindings(self) -> AsyncServiceBindingsResource:
316+
return AsyncServiceBindingsResource(self._client)
317+
302318
@cached_property
303319
def bgp(self) -> AsyncBGPResource:
304320
return AsyncBGPResource(self._client)
@@ -571,6 +587,10 @@ def __init__(self, prefixes: PrefixesResource) -> None:
571587
prefixes.get,
572588
)
573589

590+
@cached_property
591+
def service_bindings(self) -> ServiceBindingsResourceWithRawResponse:
592+
return ServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings)
593+
574594
@cached_property
575595
def bgp(self) -> BGPResourceWithRawResponse:
576596
return BGPResourceWithRawResponse(self._prefixes.bgp)
@@ -600,6 +620,10 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None:
600620
prefixes.get,
601621
)
602622

623+
@cached_property
624+
def service_bindings(self) -> AsyncServiceBindingsResourceWithRawResponse:
625+
return AsyncServiceBindingsResourceWithRawResponse(self._prefixes.service_bindings)
626+
603627
@cached_property
604628
def bgp(self) -> AsyncBGPResourceWithRawResponse:
605629
return AsyncBGPResourceWithRawResponse(self._prefixes.bgp)
@@ -629,6 +653,10 @@ def __init__(self, prefixes: PrefixesResource) -> None:
629653
prefixes.get,
630654
)
631655

656+
@cached_property
657+
def service_bindings(self) -> ServiceBindingsResourceWithStreamingResponse:
658+
return ServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings)
659+
632660
@cached_property
633661
def bgp(self) -> BGPResourceWithStreamingResponse:
634662
return BGPResourceWithStreamingResponse(self._prefixes.bgp)
@@ -658,6 +686,10 @@ def __init__(self, prefixes: AsyncPrefixesResource) -> None:
658686
prefixes.get,
659687
)
660688

689+
@cached_property
690+
def service_bindings(self) -> AsyncServiceBindingsResourceWithStreamingResponse:
691+
return AsyncServiceBindingsResourceWithStreamingResponse(self._prefixes.service_bindings)
692+
661693
@cached_property
662694
def bgp(self) -> AsyncBGPResourceWithStreamingResponse:
663695
return AsyncBGPResourceWithStreamingResponse(self._prefixes.bgp)

0 commit comments

Comments
 (0)