66
77import httpx
88
9- from ..... _types import NOT_GIVEN , Body , Query , Headers , NotGiven
10- from ..... _utils import (
9+ from ...._types import NOT_GIVEN , Body , Query , Headers , NotGiven
10+ from ...._utils import (
1111 maybe_transform ,
1212 async_maybe_transform ,
1313)
14- from ..... _compat import cached_property
15- from ..... _resource import SyncAPIResource , AsyncAPIResource
16- from ..... _response import (
14+ from ...._compat import cached_property
15+ from ...._resource import SyncAPIResource , AsyncAPIResource
16+ from ...._response import (
1717 to_raw_response_wrapper ,
1818 to_streamed_response_wrapper ,
1919 async_to_raw_response_wrapper ,
2020 async_to_streamed_response_wrapper ,
2121)
22- from ..... _wrappers import ResultWrapper
23- from ..... _base_client import make_request_options
24- from ..... types .addressing .prefixes . bgp import status_edit_params
25- from ..... types .addressing .prefixes .bgp . status_get_response import StatusGetResponse
26- from ..... types .addressing .prefixes .bgp . status_edit_response import StatusEditResponse
22+ from ...._wrappers import ResultWrapper
23+ from ...._base_client import make_request_options
24+ from ....types .addressing .prefixes import advertisement_status_edit_params
25+ from ....types .addressing .prefixes .advertisement_status_get_response import AdvertisementStatusGetResponse
26+ from ....types .addressing .prefixes .advertisement_status_edit_response import AdvertisementStatusEditResponse
2727
28- __all__ = ["StatusesResource " , "AsyncStatusesResource " ]
28+ __all__ = ["AdvertisementStatusResource " , "AsyncAdvertisementStatusResource " ]
2929
3030
31- class StatusesResource (SyncAPIResource ):
31+ class AdvertisementStatusResource (SyncAPIResource ):
3232 @cached_property
33- def with_raw_response (self ) -> StatusesResourceWithRawResponse :
33+ def with_raw_response (self ) -> AdvertisementStatusResourceWithRawResponse :
3434 """
3535 This property can be used as a prefix for any HTTP method call to return the
3636 the raw response object instead of the parsed content.
3737
3838 For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
3939 """
40- return StatusesResourceWithRawResponse (self )
40+ return AdvertisementStatusResourceWithRawResponse (self )
4141
4242 @cached_property
43- def with_streaming_response (self ) -> StatusesResourceWithStreamingResponse :
43+ def with_streaming_response (self ) -> AdvertisementStatusResourceWithStreamingResponse :
4444 """
4545 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
4646
4747 For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
4848 """
49- return StatusesResourceWithStreamingResponse (self )
49+ return AdvertisementStatusResourceWithStreamingResponse (self )
5050
5151 def edit (
5252 self ,
@@ -60,7 +60,7 @@ def edit(
6060 extra_query : Query | None = None ,
6161 extra_body : Body | None = None ,
6262 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
63- ) -> Optional [StatusEditResponse ]:
63+ ) -> Optional [AdvertisementStatusEditResponse ]:
6464 """
6565 Advertise or withdraw BGP route for a prefix.
6666
@@ -85,15 +85,19 @@ def edit(
8585 raise ValueError (f"Expected a non-empty value for `prefix_id` but received { prefix_id !r} " )
8686 return self ._patch (
8787 f"/accounts/{ account_id } /addressing/prefixes/{ prefix_id } /bgp/status" ,
88- body = maybe_transform ({"advertised" : advertised }, status_edit_params .StatusEditParams ),
88+ body = maybe_transform (
89+ {"advertised" : advertised }, advertisement_status_edit_params .AdvertisementStatusEditParams
90+ ),
8991 options = make_request_options (
9092 extra_headers = extra_headers ,
9193 extra_query = extra_query ,
9294 extra_body = extra_body ,
9395 timeout = timeout ,
94- post_parser = ResultWrapper [Optional [StatusEditResponse ]]._unwrapper ,
96+ post_parser = ResultWrapper [Optional [AdvertisementStatusEditResponse ]]._unwrapper ,
97+ ),
98+ cast_to = cast (
99+ Type [Optional [AdvertisementStatusEditResponse ]], ResultWrapper [AdvertisementStatusEditResponse ]
95100 ),
96- cast_to = cast (Type [Optional [StatusEditResponse ]], ResultWrapper [StatusEditResponse ]),
97101 )
98102
99103 def get (
@@ -107,7 +111,7 @@ def get(
107111 extra_query : Query | None = None ,
108112 extra_body : Body | None = None ,
109113 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
110- ) -> Optional [StatusGetResponse ]:
114+ ) -> Optional [AdvertisementStatusGetResponse ]:
111115 """
112116 List the current advertisement state for a prefix.
113117
@@ -135,31 +139,31 @@ def get(
135139 extra_query = extra_query ,
136140 extra_body = extra_body ,
137141 timeout = timeout ,
138- post_parser = ResultWrapper [Optional [StatusGetResponse ]]._unwrapper ,
142+ post_parser = ResultWrapper [Optional [AdvertisementStatusGetResponse ]]._unwrapper ,
139143 ),
140- cast_to = cast (Type [Optional [StatusGetResponse ]], ResultWrapper [StatusGetResponse ]),
144+ cast_to = cast (Type [Optional [AdvertisementStatusGetResponse ]], ResultWrapper [AdvertisementStatusGetResponse ]),
141145 )
142146
143147
144- class AsyncStatusesResource (AsyncAPIResource ):
148+ class AsyncAdvertisementStatusResource (AsyncAPIResource ):
145149 @cached_property
146- def with_raw_response (self ) -> AsyncStatusesResourceWithRawResponse :
150+ def with_raw_response (self ) -> AsyncAdvertisementStatusResourceWithRawResponse :
147151 """
148152 This property can be used as a prefix for any HTTP method call to return the
149153 the raw response object instead of the parsed content.
150154
151155 For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
152156 """
153- return AsyncStatusesResourceWithRawResponse (self )
157+ return AsyncAdvertisementStatusResourceWithRawResponse (self )
154158
155159 @cached_property
156- def with_streaming_response (self ) -> AsyncStatusesResourceWithStreamingResponse :
160+ def with_streaming_response (self ) -> AsyncAdvertisementStatusResourceWithStreamingResponse :
157161 """
158162 An alternative to `.with_raw_response` that doesn't eagerly read the response body.
159163
160164 For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
161165 """
162- return AsyncStatusesResourceWithStreamingResponse (self )
166+ return AsyncAdvertisementStatusResourceWithStreamingResponse (self )
163167
164168 async def edit (
165169 self ,
@@ -173,7 +177,7 @@ async def edit(
173177 extra_query : Query | None = None ,
174178 extra_body : Body | None = None ,
175179 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
176- ) -> Optional [StatusEditResponse ]:
180+ ) -> Optional [AdvertisementStatusEditResponse ]:
177181 """
178182 Advertise or withdraw BGP route for a prefix.
179183
@@ -198,15 +202,19 @@ async def edit(
198202 raise ValueError (f"Expected a non-empty value for `prefix_id` but received { prefix_id !r} " )
199203 return await self ._patch (
200204 f"/accounts/{ account_id } /addressing/prefixes/{ prefix_id } /bgp/status" ,
201- body = await async_maybe_transform ({"advertised" : advertised }, status_edit_params .StatusEditParams ),
205+ body = await async_maybe_transform (
206+ {"advertised" : advertised }, advertisement_status_edit_params .AdvertisementStatusEditParams
207+ ),
202208 options = make_request_options (
203209 extra_headers = extra_headers ,
204210 extra_query = extra_query ,
205211 extra_body = extra_body ,
206212 timeout = timeout ,
207- post_parser = ResultWrapper [Optional [StatusEditResponse ]]._unwrapper ,
213+ post_parser = ResultWrapper [Optional [AdvertisementStatusEditResponse ]]._unwrapper ,
214+ ),
215+ cast_to = cast (
216+ Type [Optional [AdvertisementStatusEditResponse ]], ResultWrapper [AdvertisementStatusEditResponse ]
208217 ),
209- cast_to = cast (Type [Optional [StatusEditResponse ]], ResultWrapper [StatusEditResponse ]),
210218 )
211219
212220 async def get (
@@ -220,7 +228,7 @@ async def get(
220228 extra_query : Query | None = None ,
221229 extra_body : Body | None = None ,
222230 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
223- ) -> Optional [StatusGetResponse ]:
231+ ) -> Optional [AdvertisementStatusGetResponse ]:
224232 """
225233 List the current advertisement state for a prefix.
226234
@@ -248,55 +256,55 @@ async def get(
248256 extra_query = extra_query ,
249257 extra_body = extra_body ,
250258 timeout = timeout ,
251- post_parser = ResultWrapper [Optional [StatusGetResponse ]]._unwrapper ,
259+ post_parser = ResultWrapper [Optional [AdvertisementStatusGetResponse ]]._unwrapper ,
252260 ),
253- cast_to = cast (Type [Optional [StatusGetResponse ]], ResultWrapper [StatusGetResponse ]),
261+ cast_to = cast (Type [Optional [AdvertisementStatusGetResponse ]], ResultWrapper [AdvertisementStatusGetResponse ]),
254262 )
255263
256264
257- class StatusesResourceWithRawResponse :
258- def __init__ (self , statuses : StatusesResource ) -> None :
259- self ._statuses = statuses
265+ class AdvertisementStatusResourceWithRawResponse :
266+ def __init__ (self , advertisement_status : AdvertisementStatusResource ) -> None :
267+ self ._advertisement_status = advertisement_status
260268
261269 self .edit = to_raw_response_wrapper (
262- statuses .edit ,
270+ advertisement_status .edit ,
263271 )
264272 self .get = to_raw_response_wrapper (
265- statuses .get ,
273+ advertisement_status .get ,
266274 )
267275
268276
269- class AsyncStatusesResourceWithRawResponse :
270- def __init__ (self , statuses : AsyncStatusesResource ) -> None :
271- self ._statuses = statuses
277+ class AsyncAdvertisementStatusResourceWithRawResponse :
278+ def __init__ (self , advertisement_status : AsyncAdvertisementStatusResource ) -> None :
279+ self ._advertisement_status = advertisement_status
272280
273281 self .edit = async_to_raw_response_wrapper (
274- statuses .edit ,
282+ advertisement_status .edit ,
275283 )
276284 self .get = async_to_raw_response_wrapper (
277- statuses .get ,
285+ advertisement_status .get ,
278286 )
279287
280288
281- class StatusesResourceWithStreamingResponse :
282- def __init__ (self , statuses : StatusesResource ) -> None :
283- self ._statuses = statuses
289+ class AdvertisementStatusResourceWithStreamingResponse :
290+ def __init__ (self , advertisement_status : AdvertisementStatusResource ) -> None :
291+ self ._advertisement_status = advertisement_status
284292
285293 self .edit = to_streamed_response_wrapper (
286- statuses .edit ,
294+ advertisement_status .edit ,
287295 )
288296 self .get = to_streamed_response_wrapper (
289- statuses .get ,
297+ advertisement_status .get ,
290298 )
291299
292300
293- class AsyncStatusesResourceWithStreamingResponse :
294- def __init__ (self , statuses : AsyncStatusesResource ) -> None :
295- self ._statuses = statuses
301+ class AsyncAdvertisementStatusResourceWithStreamingResponse :
302+ def __init__ (self , advertisement_status : AsyncAdvertisementStatusResource ) -> None :
303+ self ._advertisement_status = advertisement_status
296304
297305 self .edit = async_to_streamed_response_wrapper (
298- statuses .edit ,
306+ advertisement_status .edit ,
299307 )
300308 self .get = async_to_streamed_response_wrapper (
301- statuses .get ,
309+ advertisement_status .get ,
302310 )
0 commit comments