88import httpx
99
1010from ...._types import Body , Omit , Query , Headers , NotGiven , SequenceNotStr , omit , not_given
11- from ...._utils import maybe_transform , async_maybe_transform
11+ from ...._utils import path_template , maybe_transform , async_maybe_transform
1212from ...._compat import cached_property
1313from .credentials import (
1414 CredentialsResource ,
@@ -63,7 +63,7 @@ def with_streaming_response(self) -> ConfigurationResourceWithStreamingResponse:
6363 def create (
6464 self ,
6565 * ,
66- zone_id : str ,
66+ zone_id : str | None = None ,
6767 credentials : configuration_create_params .Credentials ,
6868 description : str ,
6969 title : str ,
@@ -90,10 +90,12 @@ def create(
9090
9191 timeout: Override the client-level default timeout for this request, in seconds
9292 """
93+ if zone_id is None :
94+ zone_id = self ._client ._get_zone_id_path_param ()
9395 if not zone_id :
9496 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
9597 return self ._post (
96- f "/zones/{ zone_id } /token_validation/config" ,
98+ path_template ( "/zones/{zone_id}/token_validation/config" , zone_id = zone_id ) ,
9799 body = maybe_transform (
98100 {
99101 "credentials" : credentials ,
@@ -117,7 +119,7 @@ def create(
117119 def list (
118120 self ,
119121 * ,
120- zone_id : str ,
122+ zone_id : str | None = None ,
121123 page : int | Omit = omit ,
122124 per_page : int | Omit = omit ,
123125 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -145,10 +147,12 @@ def list(
145147
146148 timeout: Override the client-level default timeout for this request, in seconds
147149 """
150+ if zone_id is None :
151+ zone_id = self ._client ._get_zone_id_path_param ()
148152 if not zone_id :
149153 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
150154 return self ._get_api_list (
151- f "/zones/{ zone_id } /token_validation/config" ,
155+ path_template ( "/zones/{zone_id}/token_validation/config" , zone_id = zone_id ) ,
152156 page = SyncV4PagePaginationArray [TokenConfig ],
153157 options = make_request_options (
154158 extra_headers = extra_headers ,
@@ -170,7 +174,7 @@ def delete(
170174 self ,
171175 config_id : str ,
172176 * ,
173- zone_id : str ,
177+ zone_id : str | None = None ,
174178 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
175179 # The extra values given here take precedence over values defined on the client or passed to this method.
176180 extra_headers : Headers | None = None ,
@@ -194,12 +198,14 @@ def delete(
194198
195199 timeout: Override the client-level default timeout for this request, in seconds
196200 """
201+ if zone_id is None :
202+ zone_id = self ._client ._get_zone_id_path_param ()
197203 if not zone_id :
198204 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
199205 if not config_id :
200206 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
201207 return self ._delete (
202- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
208+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
203209 options = make_request_options (
204210 extra_headers = extra_headers ,
205211 extra_query = extra_query ,
@@ -214,7 +220,7 @@ def edit(
214220 self ,
215221 config_id : str ,
216222 * ,
217- zone_id : str ,
223+ zone_id : str | None = None ,
218224 description : str | Omit = omit ,
219225 title : str | Omit = omit ,
220226 token_sources : SequenceNotStr [str ] | Omit = omit ,
@@ -241,12 +247,14 @@ def edit(
241247
242248 timeout: Override the client-level default timeout for this request, in seconds
243249 """
250+ if zone_id is None :
251+ zone_id = self ._client ._get_zone_id_path_param ()
244252 if not zone_id :
245253 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
246254 if not config_id :
247255 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
248256 return self ._patch (
249- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
257+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
250258 body = maybe_transform (
251259 {
252260 "description" : description ,
@@ -269,7 +277,7 @@ def get(
269277 self ,
270278 config_id : str ,
271279 * ,
272- zone_id : str ,
280+ zone_id : str | None = None ,
273281 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
274282 # The extra values given here take precedence over values defined on the client or passed to this method.
275283 extra_headers : Headers | None = None ,
@@ -293,12 +301,14 @@ def get(
293301
294302 timeout: Override the client-level default timeout for this request, in seconds
295303 """
304+ if zone_id is None :
305+ zone_id = self ._client ._get_zone_id_path_param ()
296306 if not zone_id :
297307 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
298308 if not config_id :
299309 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
300310 return self ._get (
301- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
311+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
302312 options = make_request_options (
303313 extra_headers = extra_headers ,
304314 extra_query = extra_query ,
@@ -337,7 +347,7 @@ def with_streaming_response(self) -> AsyncConfigurationResourceWithStreamingResp
337347 async def create (
338348 self ,
339349 * ,
340- zone_id : str ,
350+ zone_id : str | None = None ,
341351 credentials : configuration_create_params .Credentials ,
342352 description : str ,
343353 title : str ,
@@ -364,10 +374,12 @@ async def create(
364374
365375 timeout: Override the client-level default timeout for this request, in seconds
366376 """
377+ if zone_id is None :
378+ zone_id = self ._client ._get_zone_id_path_param ()
367379 if not zone_id :
368380 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
369381 return await self ._post (
370- f "/zones/{ zone_id } /token_validation/config" ,
382+ path_template ( "/zones/{zone_id}/token_validation/config" , zone_id = zone_id ) ,
371383 body = await async_maybe_transform (
372384 {
373385 "credentials" : credentials ,
@@ -391,7 +403,7 @@ async def create(
391403 def list (
392404 self ,
393405 * ,
394- zone_id : str ,
406+ zone_id : str | None = None ,
395407 page : int | Omit = omit ,
396408 per_page : int | Omit = omit ,
397409 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -419,10 +431,12 @@ def list(
419431
420432 timeout: Override the client-level default timeout for this request, in seconds
421433 """
434+ if zone_id is None :
435+ zone_id = self ._client ._get_zone_id_path_param ()
422436 if not zone_id :
423437 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
424438 return self ._get_api_list (
425- f "/zones/{ zone_id } /token_validation/config" ,
439+ path_template ( "/zones/{zone_id}/token_validation/config" , zone_id = zone_id ) ,
426440 page = AsyncV4PagePaginationArray [TokenConfig ],
427441 options = make_request_options (
428442 extra_headers = extra_headers ,
@@ -444,7 +458,7 @@ async def delete(
444458 self ,
445459 config_id : str ,
446460 * ,
447- zone_id : str ,
461+ zone_id : str | None = None ,
448462 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
449463 # The extra values given here take precedence over values defined on the client or passed to this method.
450464 extra_headers : Headers | None = None ,
@@ -468,12 +482,14 @@ async def delete(
468482
469483 timeout: Override the client-level default timeout for this request, in seconds
470484 """
485+ if zone_id is None :
486+ zone_id = self ._client ._get_zone_id_path_param ()
471487 if not zone_id :
472488 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
473489 if not config_id :
474490 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
475491 return await self ._delete (
476- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
492+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
477493 options = make_request_options (
478494 extra_headers = extra_headers ,
479495 extra_query = extra_query ,
@@ -488,7 +504,7 @@ async def edit(
488504 self ,
489505 config_id : str ,
490506 * ,
491- zone_id : str ,
507+ zone_id : str | None = None ,
492508 description : str | Omit = omit ,
493509 title : str | Omit = omit ,
494510 token_sources : SequenceNotStr [str ] | Omit = omit ,
@@ -515,12 +531,14 @@ async def edit(
515531
516532 timeout: Override the client-level default timeout for this request, in seconds
517533 """
534+ if zone_id is None :
535+ zone_id = self ._client ._get_zone_id_path_param ()
518536 if not zone_id :
519537 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
520538 if not config_id :
521539 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
522540 return await self ._patch (
523- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
541+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
524542 body = await async_maybe_transform (
525543 {
526544 "description" : description ,
@@ -543,7 +561,7 @@ async def get(
543561 self ,
544562 config_id : str ,
545563 * ,
546- zone_id : str ,
564+ zone_id : str | None = None ,
547565 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
548566 # The extra values given here take precedence over values defined on the client or passed to this method.
549567 extra_headers : Headers | None = None ,
@@ -567,12 +585,14 @@ async def get(
567585
568586 timeout: Override the client-level default timeout for this request, in seconds
569587 """
588+ if zone_id is None :
589+ zone_id = self ._client ._get_zone_id_path_param ()
570590 if not zone_id :
571591 raise ValueError (f"Expected a non-empty value for `zone_id` but received { zone_id !r} " )
572592 if not config_id :
573593 raise ValueError (f"Expected a non-empty value for `config_id` but received { config_id !r} " )
574594 return await self ._get (
575- f "/zones/{ zone_id } /token_validation/config/{ config_id } " ,
595+ path_template ( "/zones/{zone_id}/token_validation/config/{config_id}" , zone_id = zone_id , config_id = config_id ) ,
576596 options = make_request_options (
577597 extra_headers = extra_headers ,
578598 extra_query = extra_query ,
0 commit comments