77import httpx
88
99from ..._types import Body , Omit , Query , Headers , NotGiven , omit , not_given
10- from ..._utils import maybe_transform , async_maybe_transform
10+ from ..._utils import path_template , maybe_transform , async_maybe_transform
1111from ..._compat import cached_property
1212from ..._resource import SyncAPIResource , AsyncAPIResource
1313from ..._response import (
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> AccountSettingsResourceWithStreamingRespons
4848 def update (
4949 self ,
5050 * ,
51- account_id : str ,
51+ account_id : str | None = None ,
5252 default_usage_model : str | Omit = omit ,
5353 green_compute : bool | Omit = omit ,
5454 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -72,10 +72,12 @@ def update(
7272
7373 timeout: Override the client-level default timeout for this request, in seconds
7474 """
75+ if account_id is None :
76+ account_id = self ._client ._get_account_id_path_param ()
7577 if not account_id :
7678 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
7779 return self ._put (
78- f "/accounts/{ account_id } /workers/account-settings" ,
80+ path_template ( "/accounts/{account_id}/workers/account-settings" , account_id = account_id ) ,
7981 body = maybe_transform (
8082 {
8183 "default_usage_model" : default_usage_model ,
@@ -96,7 +98,7 @@ def update(
9698 def get (
9799 self ,
98100 * ,
99- account_id : str ,
101+ account_id : str | None = None ,
100102 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101103 # The extra values given here take precedence over values defined on the client or passed to this method.
102104 extra_headers : Headers | None = None ,
@@ -118,10 +120,12 @@ def get(
118120
119121 timeout: Override the client-level default timeout for this request, in seconds
120122 """
123+ if account_id is None :
124+ account_id = self ._client ._get_account_id_path_param ()
121125 if not account_id :
122126 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
123127 return self ._get (
124- f "/accounts/{ account_id } /workers/account-settings" ,
128+ path_template ( "/accounts/{account_id}/workers/account-settings" , account_id = account_id ) ,
125129 options = make_request_options (
126130 extra_headers = extra_headers ,
127131 extra_query = extra_query ,
@@ -156,7 +160,7 @@ def with_streaming_response(self) -> AsyncAccountSettingsResourceWithStreamingRe
156160 async def update (
157161 self ,
158162 * ,
159- account_id : str ,
163+ account_id : str | None = None ,
160164 default_usage_model : str | Omit = omit ,
161165 green_compute : bool | Omit = omit ,
162166 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -180,10 +184,12 @@ async def update(
180184
181185 timeout: Override the client-level default timeout for this request, in seconds
182186 """
187+ if account_id is None :
188+ account_id = self ._client ._get_account_id_path_param ()
183189 if not account_id :
184190 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
185191 return await self ._put (
186- f "/accounts/{ account_id } /workers/account-settings" ,
192+ path_template ( "/accounts/{account_id}/workers/account-settings" , account_id = account_id ) ,
187193 body = await async_maybe_transform (
188194 {
189195 "default_usage_model" : default_usage_model ,
@@ -204,7 +210,7 @@ async def update(
204210 async def get (
205211 self ,
206212 * ,
207- account_id : str ,
213+ account_id : str | None = None ,
208214 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
209215 # The extra values given here take precedence over values defined on the client or passed to this method.
210216 extra_headers : Headers | None = None ,
@@ -226,10 +232,12 @@ async def get(
226232
227233 timeout: Override the client-level default timeout for this request, in seconds
228234 """
235+ if account_id is None :
236+ account_id = self ._client ._get_account_id_path_param ()
229237 if not account_id :
230238 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
231239 return await self ._get (
232- f "/accounts/{ account_id } /workers/account-settings" ,
240+ path_template ( "/accounts/{account_id}/workers/account-settings" , account_id = account_id ) ,
233241 options = make_request_options (
234242 extra_headers = extra_headers ,
235243 extra_query = extra_query ,
0 commit comments