Skip to content

Commit ad8ffc4

Browse files
committed
feat(registrar): update generated types and methods
note: tests skipped due to pre-existing codegen bug
1 parent 10c791e commit ad8ffc4

14 files changed

Lines changed: 508 additions & 58 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Registrar
2+
3+
Types:
4+
5+
```python
6+
from cloudflare.types.registrar import (
7+
Registration,
8+
WorkflowStatus,
9+
RegistrarCheckResponse,
10+
RegistrarSearchResponse,
11+
)
12+
```
13+
14+
Methods:
15+
16+
- <code title="post /accounts/{account_id}/registrar/domain-check">client.registrar.<a href="./src/cloudflare/resources/registrar/registrar.py">check</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registrar_check_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registrar_check_response.py">RegistrarCheckResponse</a></code>
17+
- <code title="get /accounts/{account_id}/registrar/domain-search">client.registrar.<a href="./src/cloudflare/resources/registrar/registrar.py">search</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registrar_search_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registrar_search_response.py">RegistrarSearchResponse</a></code>
18+
19+
## Domains
20+
21+
Types:
22+
23+
```python
24+
from cloudflare.types.registrar import Domain
25+
```
26+
27+
Methods:
28+
29+
- <code title="put /accounts/{account_id}/registrar/domains/{domain_name}">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">update</a>(domain_name, \*, account_id, \*\*<a href="src/cloudflare/types/registrar/domain_update_params.py">params</a>) -> object</code>
30+
- <code title="get /accounts/{account_id}/registrar/domains">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/registrar/domain.py">SyncSinglePage[Domain]</a></code>
31+
- <code title="get /accounts/{account_id}/registrar/domains/{domain_name}">client.registrar.domains.<a href="./src/cloudflare/resources/registrar/domains.py">get</a>(domain_name, \*, account_id) -> object</code>
32+
33+
## Registrations
34+
35+
Methods:
36+
37+
- <code title="post /accounts/{account_id}/registrar/registrations">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_create_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
38+
- <code title="get /accounts/{account_id}/registrar/registrations">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_list_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/registration.py">SyncCursorPagination[Registration]</a></code>
39+
- <code title="patch /accounts/{account_id}/registrar/registrations/{domain_name}">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">edit</a>(domain_name, \*, account_id, \*\*<a href="src/cloudflare/types/registrar/registration_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
40+
- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}">client.registrar.registrations.<a href="./src/cloudflare/resources/registrar/registrations.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/registration.py">Registration</a></code>
41+
42+
## RegistrationStatus
43+
44+
Methods:
45+
46+
- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}/registration-status">client.registrar.registration_status.<a href="./src/cloudflare/resources/registrar/registration_status.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>
47+
48+
## UpdateStatus
49+
50+
Methods:
51+
52+
- <code title="get /accounts/{account_id}/registrar/registrations/{domain_name}/update-status">client.registrar.update_status.<a href="./src/cloudflare/resources/registrar/update_status.py">get</a>(domain_name, \*, account_id) -> <a href="./src/cloudflare/types/registrar/workflow_status.py">WorkflowStatus</a></code>

src/cloudflare/resources/registrar/domains.py

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import httpx
99

1010
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11-
from ..._utils import maybe_transform, async_maybe_transform
11+
from ..._utils import path_template, maybe_transform, async_maybe_transform
1212
from ..._compat import cached_property
1313
from ..._resource import SyncAPIResource, AsyncAPIResource
1414
from ..._response import (
@@ -53,7 +53,7 @@ def update(
5353
self,
5454
domain_name: str,
5555
*,
56-
account_id: str,
56+
account_id: str | None = None,
5757
auto_renew: bool | Omit = omit,
5858
locked: bool | Omit = omit,
5959
privacy: bool | Omit = omit,
@@ -90,12 +90,16 @@ def update(
9090
9191
timeout: Override the client-level default timeout for this request, in seconds
9292
"""
93+
if account_id is None:
94+
account_id = self._client._get_account_id_path_param()
9395
if not account_id:
9496
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
9597
if not domain_name:
9698
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
9799
return self._put(
98-
f"/accounts/{account_id}/registrar/domains/{domain_name}",
100+
path_template(
101+
"/accounts/{account_id}/registrar/domains/{domain_name}", account_id=account_id, domain_name=domain_name
102+
),
99103
body=maybe_transform(
100104
{
101105
"auto_renew": auto_renew,
@@ -120,7 +124,7 @@ def update(
120124
def list(
121125
self,
122126
*,
123-
account_id: str,
127+
account_id: str | None = None,
124128
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
125129
# The extra values given here take precedence over values defined on the client or passed to this method.
126130
extra_headers: Headers | None = None,
@@ -142,10 +146,12 @@ def list(
142146
143147
timeout: Override the client-level default timeout for this request, in seconds
144148
"""
149+
if account_id is None:
150+
account_id = self._client._get_account_id_path_param()
145151
if not account_id:
146152
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
147153
return self._get_api_list(
148-
f"/accounts/{account_id}/registrar/domains",
154+
path_template("/accounts/{account_id}/registrar/domains", account_id=account_id),
149155
page=SyncSinglePage[Domain],
150156
options=make_request_options(
151157
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -160,7 +166,7 @@ def get(
160166
self,
161167
domain_name: str,
162168
*,
163-
account_id: str,
169+
account_id: str | None = None,
164170
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
165171
# The extra values given here take precedence over values defined on the client or passed to this method.
166172
extra_headers: Headers | None = None,
@@ -187,12 +193,16 @@ def get(
187193
188194
timeout: Override the client-level default timeout for this request, in seconds
189195
"""
196+
if account_id is None:
197+
account_id = self._client._get_account_id_path_param()
190198
if not account_id:
191199
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
192200
if not domain_name:
193201
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
194202
return self._get(
195-
f"/accounts/{account_id}/registrar/domains/{domain_name}",
203+
path_template(
204+
"/accounts/{account_id}/registrar/domains/{domain_name}", account_id=account_id, domain_name=domain_name
205+
),
196206
options=make_request_options(
197207
extra_headers=extra_headers,
198208
extra_query=extra_query,
@@ -231,7 +241,7 @@ async def update(
231241
self,
232242
domain_name: str,
233243
*,
234-
account_id: str,
244+
account_id: str | None = None,
235245
auto_renew: bool | Omit = omit,
236246
locked: bool | Omit = omit,
237247
privacy: bool | Omit = omit,
@@ -268,12 +278,16 @@ async def update(
268278
269279
timeout: Override the client-level default timeout for this request, in seconds
270280
"""
281+
if account_id is None:
282+
account_id = self._client._get_account_id_path_param()
271283
if not account_id:
272284
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
273285
if not domain_name:
274286
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
275287
return await self._put(
276-
f"/accounts/{account_id}/registrar/domains/{domain_name}",
288+
path_template(
289+
"/accounts/{account_id}/registrar/domains/{domain_name}", account_id=account_id, domain_name=domain_name
290+
),
277291
body=await async_maybe_transform(
278292
{
279293
"auto_renew": auto_renew,
@@ -298,7 +312,7 @@ async def update(
298312
def list(
299313
self,
300314
*,
301-
account_id: str,
315+
account_id: str | None = None,
302316
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
303317
# The extra values given here take precedence over values defined on the client or passed to this method.
304318
extra_headers: Headers | None = None,
@@ -320,10 +334,12 @@ def list(
320334
321335
timeout: Override the client-level default timeout for this request, in seconds
322336
"""
337+
if account_id is None:
338+
account_id = self._client._get_account_id_path_param()
323339
if not account_id:
324340
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
325341
return self._get_api_list(
326-
f"/accounts/{account_id}/registrar/domains",
342+
path_template("/accounts/{account_id}/registrar/domains", account_id=account_id),
327343
page=AsyncSinglePage[Domain],
328344
options=make_request_options(
329345
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -338,7 +354,7 @@ async def get(
338354
self,
339355
domain_name: str,
340356
*,
341-
account_id: str,
357+
account_id: str | None = None,
342358
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343359
# The extra values given here take precedence over values defined on the client or passed to this method.
344360
extra_headers: Headers | None = None,
@@ -365,12 +381,16 @@ async def get(
365381
366382
timeout: Override the client-level default timeout for this request, in seconds
367383
"""
384+
if account_id is None:
385+
account_id = self._client._get_account_id_path_param()
368386
if not account_id:
369387
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
370388
if not domain_name:
371389
raise ValueError(f"Expected a non-empty value for `domain_name` but received {domain_name!r}")
372390
return await self._get(
373-
f"/accounts/{account_id}/registrar/domains/{domain_name}",
391+
path_template(
392+
"/accounts/{account_id}/registrar/domains/{domain_name}", account_id=account_id, domain_name=domain_name
393+
),
374394
options=make_request_options(
375395
extra_headers=extra_headers,
376396
extra_query=extra_query,

src/cloudflare/resources/registrar/registrar.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
AsyncDomainsResourceWithStreamingResponse,
1616
)
1717
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
18-
from ..._utils import maybe_transform, async_maybe_transform
18+
from ..._utils import path_template, maybe_transform, async_maybe_transform
1919
from ..._compat import cached_property
2020
from ..._resource import SyncAPIResource, AsyncAPIResource
2121
from ..._response import (
@@ -96,7 +96,7 @@ def with_streaming_response(self) -> RegistrarResourceWithStreamingResponse:
9696
def check(
9797
self,
9898
*,
99-
account_id: str,
99+
account_id: str | None = None,
100100
domains: SequenceNotStr[str],
101101
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
102102
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -175,10 +175,12 @@ def check(
175175
176176
timeout: Override the client-level default timeout for this request, in seconds
177177
"""
178+
if account_id is None:
179+
account_id = self._client._get_account_id_path_param()
178180
if not account_id:
179181
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
180182
return self._post(
181-
f"/accounts/{account_id}/registrar/domain-check",
183+
path_template("/accounts/{account_id}/registrar/domain-check", account_id=account_id),
182184
body=maybe_transform({"domains": domains}, registrar_check_params.RegistrarCheckParams),
183185
options=make_request_options(
184186
extra_headers=extra_headers,
@@ -193,7 +195,7 @@ def check(
193195
def search(
194196
self,
195197
*,
196-
account_id: str,
198+
account_id: str | None = None,
197199
q: str,
198200
extensions: SequenceNotStr[str] | Omit = omit,
199201
limit: int | Omit = omit,
@@ -215,8 +217,7 @@ def search(
215217
216218
Suggestions are scoped to extensions supported for programmatic registration via
217219
this API (`POST /registrations`). Domains on unsupported extensions will not
218-
appear in results, even if they are available at the registry level. See the
219-
supported extensions list in `info.description`.
220+
appear in results, even if they are available at the registry level.
220221
221222
### Use cases
222223
@@ -262,10 +263,12 @@ def search(
262263
263264
timeout: Override the client-level default timeout for this request, in seconds
264265
"""
266+
if account_id is None:
267+
account_id = self._client._get_account_id_path_param()
265268
if not account_id:
266269
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
267270
return self._get(
268-
f"/accounts/{account_id}/registrar/domain-search",
271+
path_template("/accounts/{account_id}/registrar/domain-search", account_id=account_id),
269272
options=make_request_options(
270273
extra_headers=extra_headers,
271274
extra_query=extra_query,
@@ -324,7 +327,7 @@ def with_streaming_response(self) -> AsyncRegistrarResourceWithStreamingResponse
324327
async def check(
325328
self,
326329
*,
327-
account_id: str,
330+
account_id: str | None = None,
328331
domains: SequenceNotStr[str],
329332
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
330333
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -403,10 +406,12 @@ async def check(
403406
404407
timeout: Override the client-level default timeout for this request, in seconds
405408
"""
409+
if account_id is None:
410+
account_id = self._client._get_account_id_path_param()
406411
if not account_id:
407412
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
408413
return await self._post(
409-
f"/accounts/{account_id}/registrar/domain-check",
414+
path_template("/accounts/{account_id}/registrar/domain-check", account_id=account_id),
410415
body=await async_maybe_transform({"domains": domains}, registrar_check_params.RegistrarCheckParams),
411416
options=make_request_options(
412417
extra_headers=extra_headers,
@@ -421,7 +426,7 @@ async def check(
421426
async def search(
422427
self,
423428
*,
424-
account_id: str,
429+
account_id: str | None = None,
425430
q: str,
426431
extensions: SequenceNotStr[str] | Omit = omit,
427432
limit: int | Omit = omit,
@@ -443,8 +448,7 @@ async def search(
443448
444449
Suggestions are scoped to extensions supported for programmatic registration via
445450
this API (`POST /registrations`). Domains on unsupported extensions will not
446-
appear in results, even if they are available at the registry level. See the
447-
supported extensions list in `info.description`.
451+
appear in results, even if they are available at the registry level.
448452
449453
### Use cases
450454
@@ -490,10 +494,12 @@ async def search(
490494
491495
timeout: Override the client-level default timeout for this request, in seconds
492496
"""
497+
if account_id is None:
498+
account_id = self._client._get_account_id_path_param()
493499
if not account_id:
494500
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
495501
return await self._get(
496-
f"/accounts/{account_id}/registrar/domain-search",
502+
path_template("/accounts/{account_id}/registrar/domain-search", account_id=account_id),
497503
options=make_request_options(
498504
extra_headers=extra_headers,
499505
extra_query=extra_query,

0 commit comments

Comments
 (0)