1515 AssetsResourceWithStreamingResponse ,
1616 AsyncAssetsResourceWithStreamingResponse ,
1717)
18- from ..._types import Body , Omit , Query , Headers , NotGiven , omit , not_given
19- from ..._utils import maybe_transform , async_maybe_transform
18+ from ..._types import Body , Query , Headers , NotGiven , not_given
19+ from ..._utils import path_template , maybe_transform , async_maybe_transform
2020from ..._compat import cached_property
2121from ..._resource import SyncAPIResource , AsyncAPIResource
2222from ..._response import (
@@ -77,8 +77,8 @@ def update(
7777 * ,
7878 state : Literal ["default" , "customized" ],
7979 url : str ,
80- account_id : str | Omit = omit ,
81- zone_id : str | Omit = omit ,
80+ account_id : str | None = None ,
81+ zone_id : str | None = None ,
8282 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8383 # The extra values given here take precedence over values defined on the client or passed to this method.
8484 extra_headers : Headers | None = None ,
@@ -110,6 +110,10 @@ def update(
110110 """
111111 if not identifier :
112112 raise ValueError (f"Expected a non-empty value for `identifier` but received { identifier !r} " )
113+ if account_id is None :
114+ account_id = self ._client ._get_account_id_path_param ()
115+ if zone_id is None :
116+ zone_id = self ._client ._get_zone_id_path_param ()
113117 if account_id and zone_id :
114118 raise ValueError ("You cannot provide both account_id and zone_id" )
115119
@@ -123,7 +127,12 @@ def update(
123127 account_or_zone = "zones"
124128 account_or_zone_id = zone_id
125129 return self ._put (
126- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages/{ identifier } " ,
130+ path_template (
131+ "/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}" ,
132+ identifier = identifier ,
133+ account_or_zone = account_or_zone ,
134+ account_or_zone_id = account_or_zone_id ,
135+ ),
127136 body = maybe_transform (
128137 {
129138 "state" : state ,
@@ -144,8 +153,8 @@ def update(
144153 def list (
145154 self ,
146155 * ,
147- account_id : str | Omit = omit ,
148- zone_id : str | Omit = omit ,
156+ account_id : str | None = None ,
157+ zone_id : str | None = None ,
149158 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
150159 # The extra values given here take precedence over values defined on the client or passed to this method.
151160 extra_headers : Headers | None = None ,
@@ -169,6 +178,10 @@ def list(
169178
170179 timeout: Override the client-level default timeout for this request, in seconds
171180 """
181+ if account_id is None :
182+ account_id = self ._client ._get_account_id_path_param ()
183+ if zone_id is None :
184+ zone_id = self ._client ._get_zone_id_path_param ()
172185 if account_id and zone_id :
173186 raise ValueError ("You cannot provide both account_id and zone_id" )
174187
@@ -182,7 +195,11 @@ def list(
182195 account_or_zone = "zones"
183196 account_or_zone_id = zone_id
184197 return self ._get_api_list (
185- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages" ,
198+ path_template (
199+ "/{account_or_zone}/{account_or_zone_id}/custom_pages" ,
200+ account_or_zone = account_or_zone ,
201+ account_or_zone_id = account_or_zone_id ,
202+ ),
186203 page = SyncSinglePage [CustomPageListResponse ],
187204 options = make_request_options (
188205 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
@@ -205,8 +222,8 @@ def get(
205222 "waf_challenge" ,
206223 ],
207224 * ,
208- account_id : str | Omit = omit ,
209- zone_id : str | Omit = omit ,
225+ account_id : str | None = None ,
226+ zone_id : str | None = None ,
210227 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
211228 # The extra values given here take precedence over values defined on the client or passed to this method.
212229 extra_headers : Headers | None = None ,
@@ -234,6 +251,10 @@ def get(
234251 """
235252 if not identifier :
236253 raise ValueError (f"Expected a non-empty value for `identifier` but received { identifier !r} " )
254+ if account_id is None :
255+ account_id = self ._client ._get_account_id_path_param ()
256+ if zone_id is None :
257+ zone_id = self ._client ._get_zone_id_path_param ()
237258 if account_id and zone_id :
238259 raise ValueError ("You cannot provide both account_id and zone_id" )
239260
@@ -247,7 +268,12 @@ def get(
247268 account_or_zone = "zones"
248269 account_or_zone_id = zone_id
249270 return self ._get (
250- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages/{ identifier } " ,
271+ path_template (
272+ "/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}" ,
273+ identifier = identifier ,
274+ account_or_zone = account_or_zone ,
275+ account_or_zone_id = account_or_zone_id ,
276+ ),
251277 options = make_request_options (
252278 extra_headers = extra_headers ,
253279 extra_query = extra_query ,
@@ -300,8 +326,8 @@ async def update(
300326 * ,
301327 state : Literal ["default" , "customized" ],
302328 url : str ,
303- account_id : str | Omit = omit ,
304- zone_id : str | Omit = omit ,
329+ account_id : str | None = None ,
330+ zone_id : str | None = None ,
305331 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
306332 # The extra values given here take precedence over values defined on the client or passed to this method.
307333 extra_headers : Headers | None = None ,
@@ -333,6 +359,10 @@ async def update(
333359 """
334360 if not identifier :
335361 raise ValueError (f"Expected a non-empty value for `identifier` but received { identifier !r} " )
362+ if account_id is None :
363+ account_id = self ._client ._get_account_id_path_param ()
364+ if zone_id is None :
365+ zone_id = self ._client ._get_zone_id_path_param ()
336366 if account_id and zone_id :
337367 raise ValueError ("You cannot provide both account_id and zone_id" )
338368
@@ -346,7 +376,12 @@ async def update(
346376 account_or_zone = "zones"
347377 account_or_zone_id = zone_id
348378 return await self ._put (
349- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages/{ identifier } " ,
379+ path_template (
380+ "/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}" ,
381+ identifier = identifier ,
382+ account_or_zone = account_or_zone ,
383+ account_or_zone_id = account_or_zone_id ,
384+ ),
350385 body = await async_maybe_transform (
351386 {
352387 "state" : state ,
@@ -367,8 +402,8 @@ async def update(
367402 def list (
368403 self ,
369404 * ,
370- account_id : str | Omit = omit ,
371- zone_id : str | Omit = omit ,
405+ account_id : str | None = None ,
406+ zone_id : str | None = None ,
372407 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
373408 # The extra values given here take precedence over values defined on the client or passed to this method.
374409 extra_headers : Headers | None = None ,
@@ -392,6 +427,10 @@ def list(
392427
393428 timeout: Override the client-level default timeout for this request, in seconds
394429 """
430+ if account_id is None :
431+ account_id = self ._client ._get_account_id_path_param ()
432+ if zone_id is None :
433+ zone_id = self ._client ._get_zone_id_path_param ()
395434 if account_id and zone_id :
396435 raise ValueError ("You cannot provide both account_id and zone_id" )
397436
@@ -405,7 +444,11 @@ def list(
405444 account_or_zone = "zones"
406445 account_or_zone_id = zone_id
407446 return self ._get_api_list (
408- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages" ,
447+ path_template (
448+ "/{account_or_zone}/{account_or_zone_id}/custom_pages" ,
449+ account_or_zone = account_or_zone ,
450+ account_or_zone_id = account_or_zone_id ,
451+ ),
409452 page = AsyncSinglePage [CustomPageListResponse ],
410453 options = make_request_options (
411454 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
@@ -428,8 +471,8 @@ async def get(
428471 "waf_challenge" ,
429472 ],
430473 * ,
431- account_id : str | Omit = omit ,
432- zone_id : str | Omit = omit ,
474+ account_id : str | None = None ,
475+ zone_id : str | None = None ,
433476 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
434477 # The extra values given here take precedence over values defined on the client or passed to this method.
435478 extra_headers : Headers | None = None ,
@@ -457,6 +500,10 @@ async def get(
457500 """
458501 if not identifier :
459502 raise ValueError (f"Expected a non-empty value for `identifier` but received { identifier !r} " )
503+ if account_id is None :
504+ account_id = self ._client ._get_account_id_path_param ()
505+ if zone_id is None :
506+ zone_id = self ._client ._get_zone_id_path_param ()
460507 if account_id and zone_id :
461508 raise ValueError ("You cannot provide both account_id and zone_id" )
462509
@@ -470,7 +517,12 @@ async def get(
470517 account_or_zone = "zones"
471518 account_or_zone_id = zone_id
472519 return await self ._get (
473- f"/{ account_or_zone } /{ account_or_zone_id } /custom_pages/{ identifier } " ,
520+ path_template (
521+ "/{account_or_zone}/{account_or_zone_id}/custom_pages/{identifier}" ,
522+ identifier = identifier ,
523+ account_or_zone = account_or_zone ,
524+ account_or_zone_id = account_or_zone_id ,
525+ ),
474526 options = make_request_options (
475527 extra_headers = extra_headers ,
476528 extra_query = extra_query ,
0 commit comments