Skip to content

Commit bebdf0b

Browse files
committed
feat(web3): update generated types and methods
1 parent 49e0abe commit bebdf0b

9 files changed

Lines changed: 221 additions & 57 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Web3
2+
3+
## Hostnames
4+
5+
Types:
6+
7+
```python
8+
from cloudflare.types.web3 import Hostname, HostnameDeleteResponse
9+
```
10+
11+
Methods:
12+
13+
- <code title="post /zones/{zone_id}/web3/hostnames">client.web3.hostnames.<a href="./src/cloudflare/resources/web3/hostnames/hostnames.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/web3/hostname_create_params.py">params</a>) -> <a href="./src/cloudflare/types/web3/hostname.py">Hostname</a></code>
14+
- <code title="get /zones/{zone_id}/web3/hostnames">client.web3.hostnames.<a href="./src/cloudflare/resources/web3/hostnames/hostnames.py">list</a>(\*, zone_id) -> <a href="./src/cloudflare/types/web3/hostname.py">SyncSinglePage[Hostname]</a></code>
15+
- <code title="delete /zones/{zone_id}/web3/hostnames/{identifier}">client.web3.hostnames.<a href="./src/cloudflare/resources/web3/hostnames/hostnames.py">delete</a>(identifier, \*, zone_id) -> <a href="./src/cloudflare/types/web3/hostname_delete_response.py">Optional[HostnameDeleteResponse]</a></code>
16+
- <code title="patch /zones/{zone_id}/web3/hostnames/{identifier}">client.web3.hostnames.<a href="./src/cloudflare/resources/web3/hostnames/hostnames.py">edit</a>(identifier, \*, zone_id, \*\*<a href="src/cloudflare/types/web3/hostname_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/web3/hostname.py">Hostname</a></code>
17+
- <code title="get /zones/{zone_id}/web3/hostnames/{identifier}">client.web3.hostnames.<a href="./src/cloudflare/resources/web3/hostnames/hostnames.py">get</a>(identifier, \*, zone_id) -> <a href="./src/cloudflare/types/web3/hostname.py">Hostname</a></code>
18+
19+
### IPFSUniversalPaths
20+
21+
#### ContentLists
22+
23+
Types:
24+
25+
```python
26+
from cloudflare.types.web3.hostnames.ipfs_universal_paths import ContentList
27+
```
28+
29+
Methods:
30+
31+
- <code title="put /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list">client.web3.hostnames.ipfs_universal_paths.content_lists.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py">update</a>(identifier, \*, zone_id, \*\*<a href="src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py">params</a>) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list.py">ContentList</a></code>
32+
- <code title="get /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list">client.web3.hostnames.ipfs_universal_paths.content_lists.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py">get</a>(identifier, \*, zone_id) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list.py">ContentList</a></code>
33+
34+
##### Entries
35+
36+
Types:
37+
38+
```python
39+
from cloudflare.types.web3.hostnames.ipfs_universal_paths.content_lists import (
40+
EntryCreateResponse,
41+
EntryUpdateResponse,
42+
EntryListResponse,
43+
EntryDeleteResponse,
44+
EntryGetResponse,
45+
)
46+
```
47+
48+
Methods:
49+
50+
- <code title="post /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries">client.web3.hostnames.ipfs_universal_paths.content_lists.entries.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py">create</a>(identifier, \*, zone_id, \*\*<a href="src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_params.py">params</a>) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_response.py">EntryCreateResponse</a></code>
51+
- <code title="put /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}">client.web3.hostnames.ipfs_universal_paths.content_lists.entries.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py">update</a>(content_list_entry_identifier, \*, zone_id, identifier, \*\*<a href="src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_params.py">params</a>) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_response.py">EntryUpdateResponse</a></code>
52+
- <code title="get /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries">client.web3.hostnames.ipfs_universal_paths.content_lists.entries.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py">list</a>(identifier, \*, zone_id) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_list_response.py">Optional[EntryListResponse]</a></code>
53+
- <code title="delete /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}">client.web3.hostnames.ipfs_universal_paths.content_lists.entries.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py">delete</a>(content_list_entry_identifier, \*, zone_id, identifier) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_delete_response.py">Optional[EntryDeleteResponse]</a></code>
54+
- <code title="get /zones/{zone_id}/web3/hostnames/{identifier}/ipfs_universal_path/content_list/entries/{content_list_entry_identifier}">client.web3.hostnames.ipfs_universal_paths.content_lists.entries.<a href="./src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py">get</a>(content_list_entry_identifier, \*, zone_id, identifier) -> <a href="./src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_get_response.py">EntryGetResponse</a></code>

src/cloudflare/resources/web3/hostnames/hostnames.py

Lines changed: 41 additions & 21 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 (
@@ -62,7 +62,7 @@ def with_streaming_response(self) -> HostnamesResourceWithStreamingResponse:
6262
def create(
6363
self,
6464
*,
65-
zone_id: str,
65+
zone_id: str | None = None,
6666
name: str,
6767
target: Literal["ethereum", "ipfs", "ipfs_universal_path"],
6868
description: str | Omit = omit,
@@ -96,10 +96,12 @@ def create(
9696
9797
timeout: Override the client-level default timeout for this request, in seconds
9898
"""
99+
if zone_id is None:
100+
zone_id = self._client._get_zone_id_path_param()
99101
if not zone_id:
100102
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
101103
return self._post(
102-
f"/zones/{zone_id}/web3/hostnames",
104+
path_template("/zones/{zone_id}/web3/hostnames", zone_id=zone_id),
103105
body=maybe_transform(
104106
{
105107
"name": name,
@@ -122,7 +124,7 @@ def create(
122124
def list(
123125
self,
124126
*,
125-
zone_id: str,
127+
zone_id: str | None = None,
126128
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
127129
# The extra values given here take precedence over values defined on the client or passed to this method.
128130
extra_headers: Headers | None = None,
@@ -144,10 +146,12 @@ def list(
144146
145147
timeout: Override the client-level default timeout for this request, in seconds
146148
"""
149+
if zone_id is None:
150+
zone_id = self._client._get_zone_id_path_param()
147151
if not zone_id:
148152
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
149153
return self._get_api_list(
150-
f"/zones/{zone_id}/web3/hostnames",
154+
path_template("/zones/{zone_id}/web3/hostnames", zone_id=zone_id),
151155
page=SyncSinglePage[Hostname],
152156
options=make_request_options(
153157
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -159,7 +163,7 @@ def delete(
159163
self,
160164
identifier: str,
161165
*,
162-
zone_id: str,
166+
zone_id: str | None = None,
163167
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
164168
# The extra values given here take precedence over values defined on the client or passed to this method.
165169
extra_headers: Headers | None = None,
@@ -183,12 +187,14 @@ def delete(
183187
184188
timeout: Override the client-level default timeout for this request, in seconds
185189
"""
190+
if zone_id is None:
191+
zone_id = self._client._get_zone_id_path_param()
186192
if not zone_id:
187193
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
188194
if not identifier:
189195
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
190196
return self._delete(
191-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
197+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
192198
options=make_request_options(
193199
extra_headers=extra_headers,
194200
extra_query=extra_query,
@@ -203,7 +209,7 @@ def edit(
203209
self,
204210
identifier: str,
205211
*,
206-
zone_id: str,
212+
zone_id: str | None = None,
207213
description: str | Omit = omit,
208214
dnslink: str | Omit = omit,
209215
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -233,12 +239,14 @@ def edit(
233239
234240
timeout: Override the client-level default timeout for this request, in seconds
235241
"""
242+
if zone_id is None:
243+
zone_id = self._client._get_zone_id_path_param()
236244
if not zone_id:
237245
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
238246
if not identifier:
239247
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
240248
return self._patch(
241-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
249+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
242250
body=maybe_transform(
243251
{
244252
"description": description,
@@ -260,7 +268,7 @@ def get(
260268
self,
261269
identifier: str,
262270
*,
263-
zone_id: str,
271+
zone_id: str | None = None,
264272
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
265273
# The extra values given here take precedence over values defined on the client or passed to this method.
266274
extra_headers: Headers | None = None,
@@ -284,12 +292,14 @@ def get(
284292
285293
timeout: Override the client-level default timeout for this request, in seconds
286294
"""
295+
if zone_id is None:
296+
zone_id = self._client._get_zone_id_path_param()
287297
if not zone_id:
288298
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
289299
if not identifier:
290300
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
291301
return self._get(
292-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
302+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
293303
options=make_request_options(
294304
extra_headers=extra_headers,
295305
extra_query=extra_query,
@@ -328,7 +338,7 @@ def with_streaming_response(self) -> AsyncHostnamesResourceWithStreamingResponse
328338
async def create(
329339
self,
330340
*,
331-
zone_id: str,
341+
zone_id: str | None = None,
332342
name: str,
333343
target: Literal["ethereum", "ipfs", "ipfs_universal_path"],
334344
description: str | Omit = omit,
@@ -362,10 +372,12 @@ async def create(
362372
363373
timeout: Override the client-level default timeout for this request, in seconds
364374
"""
375+
if zone_id is None:
376+
zone_id = self._client._get_zone_id_path_param()
365377
if not zone_id:
366378
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
367379
return await self._post(
368-
f"/zones/{zone_id}/web3/hostnames",
380+
path_template("/zones/{zone_id}/web3/hostnames", zone_id=zone_id),
369381
body=await async_maybe_transform(
370382
{
371383
"name": name,
@@ -388,7 +400,7 @@ async def create(
388400
def list(
389401
self,
390402
*,
391-
zone_id: str,
403+
zone_id: str | None = None,
392404
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
393405
# The extra values given here take precedence over values defined on the client or passed to this method.
394406
extra_headers: Headers | None = None,
@@ -410,10 +422,12 @@ def list(
410422
411423
timeout: Override the client-level default timeout for this request, in seconds
412424
"""
425+
if zone_id is None:
426+
zone_id = self._client._get_zone_id_path_param()
413427
if not zone_id:
414428
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
415429
return self._get_api_list(
416-
f"/zones/{zone_id}/web3/hostnames",
430+
path_template("/zones/{zone_id}/web3/hostnames", zone_id=zone_id),
417431
page=AsyncSinglePage[Hostname],
418432
options=make_request_options(
419433
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -425,7 +439,7 @@ async def delete(
425439
self,
426440
identifier: str,
427441
*,
428-
zone_id: str,
442+
zone_id: str | None = None,
429443
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
430444
# The extra values given here take precedence over values defined on the client or passed to this method.
431445
extra_headers: Headers | None = None,
@@ -449,12 +463,14 @@ async def delete(
449463
450464
timeout: Override the client-level default timeout for this request, in seconds
451465
"""
466+
if zone_id is None:
467+
zone_id = self._client._get_zone_id_path_param()
452468
if not zone_id:
453469
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
454470
if not identifier:
455471
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
456472
return await self._delete(
457-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
473+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
458474
options=make_request_options(
459475
extra_headers=extra_headers,
460476
extra_query=extra_query,
@@ -469,7 +485,7 @@ async def edit(
469485
self,
470486
identifier: str,
471487
*,
472-
zone_id: str,
488+
zone_id: str | None = None,
473489
description: str | Omit = omit,
474490
dnslink: str | Omit = omit,
475491
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -499,12 +515,14 @@ async def edit(
499515
500516
timeout: Override the client-level default timeout for this request, in seconds
501517
"""
518+
if zone_id is None:
519+
zone_id = self._client._get_zone_id_path_param()
502520
if not zone_id:
503521
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
504522
if not identifier:
505523
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
506524
return await self._patch(
507-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
525+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
508526
body=await async_maybe_transform(
509527
{
510528
"description": description,
@@ -526,7 +544,7 @@ async def get(
526544
self,
527545
identifier: str,
528546
*,
529-
zone_id: str,
547+
zone_id: str | None = None,
530548
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
531549
# The extra values given here take precedence over values defined on the client or passed to this method.
532550
extra_headers: Headers | None = None,
@@ -550,12 +568,14 @@ async def get(
550568
551569
timeout: Override the client-level default timeout for this request, in seconds
552570
"""
571+
if zone_id is None:
572+
zone_id = self._client._get_zone_id_path_param()
553573
if not zone_id:
554574
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
555575
if not identifier:
556576
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
557577
return await self._get(
558-
f"/zones/{zone_id}/web3/hostnames/{identifier}",
578+
path_template("/zones/{zone_id}/web3/hostnames/{identifier}", zone_id=zone_id, identifier=identifier),
559579
options=make_request_options(
560580
extra_headers=extra_headers,
561581
extra_query=extra_query,

0 commit comments

Comments
 (0)