Skip to content

Commit eeb3152

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat: update via SDK Studio (#92)
1 parent 30f3423 commit eeb3152

File tree

1,268 files changed

+56835
-11586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,268 files changed

+56835
-11586
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ client = Cloudflare(
3030
api_email=os.environ.get("CLOUDFLARE_EMAIL"),
3131
)
3232

33-
zones_zone = client.zones.create(
33+
zone_create_response = client.zones.create(
3434
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
3535
name="example.com",
3636
type="full",
3737
)
38-
print(zones_zone.id)
38+
print(zone_create_response.id)
3939
```
4040

4141
While you can provide a `api_email` keyword argument,
@@ -59,12 +59,12 @@ client = AsyncCloudflare(
5959

6060

6161
async def main() -> None:
62-
zones_zone = await client.zones.create(
62+
zone_create_response = await client.zones.create(
6363
account={"id": "023e105f4ecef8ad9ca31a8372d0c353"},
6464
name="example.com",
6565
type="full",
6666
)
67-
print(zones_zone.id)
67+
print(zone_create_response.id)
6868

6969

7070
asyncio.run(main())

api.md

+1,219-790
Large diffs are not rendered by default.

src/cloudflare/_client.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ def default_headers(self) -> dict[str, str | Omit]:
335335
return {
336336
**super().default_headers,
337337
"X-Stainless-Async": "false",
338-
"X-Auth-Key": self.api_key if self.api_key is not None else Omit(),
339-
"X-Auth-Email": self.api_email if self.api_email is not None else Omit(),
338+
"x-auth-email": self.api_email if self.api_email is not None else Omit(),
340339
**self._custom_headers,
341340
}
342341

@@ -746,8 +745,7 @@ def default_headers(self) -> dict[str, str | Omit]:
746745
return {
747746
**super().default_headers,
748747
"X-Stainless-Async": f"async:{get_async_library()}",
749-
"X-Auth-Key": self.api_key if self.api_key is not None else Omit(),
750-
"X-Auth-Email": self.api_email if self.api_email is not None else Omit(),
748+
"x-auth-email": self.api_email if self.api_email is not None else Omit(),
751749
**self._custom_headers,
752750
}
753751

src/cloudflare/resources/accounts/members.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
)
2929
from ...types.accounts import (
3030
AccountMember,
31+
MemberListResponse,
3132
AccountMemberWithID,
3233
MemberDeleteResponse,
33-
IamComponentsSchemasMember,
3434
member_list_params,
3535
member_create_params,
3636
member_update_params,
@@ -157,7 +157,7 @@ def list(
157157
extra_query: Query | None = None,
158158
extra_body: Body | None = None,
159159
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
160-
) -> SyncV4PagePaginationArray[IamComponentsSchemasMember]:
160+
) -> SyncV4PagePaginationArray[MemberListResponse]:
161161
"""
162162
List all members of an account.
163163
@@ -182,7 +182,7 @@ def list(
182182
"""
183183
return self._get_api_list(
184184
f"/accounts/{account_id}/members",
185-
page=SyncV4PagePaginationArray[IamComponentsSchemasMember],
185+
page=SyncV4PagePaginationArray[MemberListResponse],
186186
options=make_request_options(
187187
extra_headers=extra_headers,
188188
extra_query=extra_query,
@@ -199,7 +199,7 @@ def list(
199199
member_list_params.MemberListParams,
200200
),
201201
),
202-
model=IamComponentsSchemasMember,
202+
model=MemberListResponse,
203203
)
204204

205205
def delete(
@@ -401,7 +401,7 @@ def list(
401401
extra_query: Query | None = None,
402402
extra_body: Body | None = None,
403403
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
404-
) -> AsyncPaginator[IamComponentsSchemasMember, AsyncV4PagePaginationArray[IamComponentsSchemasMember]]:
404+
) -> AsyncPaginator[MemberListResponse, AsyncV4PagePaginationArray[MemberListResponse]]:
405405
"""
406406
List all members of an account.
407407
@@ -426,7 +426,7 @@ def list(
426426
"""
427427
return self._get_api_list(
428428
f"/accounts/{account_id}/members",
429-
page=AsyncV4PagePaginationArray[IamComponentsSchemasMember],
429+
page=AsyncV4PagePaginationArray[MemberListResponse],
430430
options=make_request_options(
431431
extra_headers=extra_headers,
432432
extra_query=extra_query,
@@ -443,7 +443,7 @@ def list(
443443
member_list_params.MemberListParams,
444444
),
445445
),
446-
model=IamComponentsSchemasMember,
446+
model=MemberListResponse,
447447
)
448448

449449
async def delete(

src/cloudflare/resources/addressing/address_maps/address_maps.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
make_request_options,
4949
)
5050
from ....types.addressing import (
51-
AddressingAddressMaps,
5251
AddressMapGetResponse,
52+
AddressMapEditResponse,
5353
AddressMapListResponse,
5454
AddressMapCreateResponse,
5555
AddressMapDeleteResponse,
@@ -239,7 +239,7 @@ def edit(
239239
extra_query: Query | None = None,
240240
extra_body: Body | None = None,
241241
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
242-
) -> AddressingAddressMaps:
242+
) -> AddressMapEditResponse:
243243
"""
244244
Modify properties of an address map owned by the account.
245245
@@ -289,7 +289,7 @@ def edit(
289289
timeout=timeout,
290290
post_parser=ResultWrapper._unwrapper,
291291
),
292-
cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]),
292+
cast_to=cast(Type[AddressMapEditResponse], ResultWrapper[AddressMapEditResponse]),
293293
)
294294

295295
def get(
@@ -516,7 +516,7 @@ async def edit(
516516
extra_query: Query | None = None,
517517
extra_body: Body | None = None,
518518
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
519-
) -> AddressingAddressMaps:
519+
) -> AddressMapEditResponse:
520520
"""
521521
Modify properties of an address map owned by the account.
522522
@@ -566,7 +566,7 @@ async def edit(
566566
timeout=timeout,
567567
post_parser=ResultWrapper._unwrapper,
568568
),
569-
cast_to=cast(Type[AddressingAddressMaps], ResultWrapper[AddressingAddressMaps]),
569+
cast_to=cast(Type[AddressMapEditResponse], ResultWrapper[AddressMapEditResponse]),
570570
)
571571

572572
async def get(

src/cloudflare/resources/addressing/prefixes/bgp/bindings.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
make_request_options,
2525
)
2626
from .....types.addressing.prefixes.bgp import (
27+
BindingGetResponse,
2728
BindingListResponse,
29+
BindingCreateResponse,
2830
BindingDeleteResponse,
29-
AddressingServiceBinding,
3031
binding_create_params,
3132
)
3233

@@ -55,7 +56,7 @@ def create(
5556
extra_query: Query | None = None,
5657
extra_body: Body | None = None,
5758
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58-
) -> AddressingServiceBinding:
59+
) -> BindingCreateResponse:
5960
"""
6061
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
6162
service running on Cloudflare's network. **Note:** This API may only be used on
@@ -99,7 +100,7 @@ def create(
99100
timeout=timeout,
100101
post_parser=ResultWrapper._unwrapper,
101102
),
102-
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
103+
cast_to=cast(Type[BindingCreateResponse], ResultWrapper[BindingCreateResponse]),
103104
)
104105

105106
def list(
@@ -218,7 +219,7 @@ def get(
218219
extra_query: Query | None = None,
219220
extra_body: Body | None = None,
220221
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
221-
) -> AddressingServiceBinding:
222+
) -> BindingGetResponse:
222223
"""
223224
Fetch a single Service Binding
224225
@@ -252,7 +253,7 @@ def get(
252253
timeout=timeout,
253254
post_parser=ResultWrapper._unwrapper,
254255
),
255-
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
256+
cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]),
256257
)
257258

258259

@@ -278,7 +279,7 @@ async def create(
278279
extra_query: Query | None = None,
279280
extra_body: Body | None = None,
280281
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
281-
) -> AddressingServiceBinding:
282+
) -> BindingCreateResponse:
282283
"""
283284
Creates a new Service Binding, routing traffic to IPs within the given CIDR to a
284285
service running on Cloudflare's network. **Note:** This API may only be used on
@@ -322,7 +323,7 @@ async def create(
322323
timeout=timeout,
323324
post_parser=ResultWrapper._unwrapper,
324325
),
325-
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
326+
cast_to=cast(Type[BindingCreateResponse], ResultWrapper[BindingCreateResponse]),
326327
)
327328

328329
async def list(
@@ -441,7 +442,7 @@ async def get(
441442
extra_query: Query | None = None,
442443
extra_body: Body | None = None,
443444
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
444-
) -> AddressingServiceBinding:
445+
) -> BindingGetResponse:
445446
"""
446447
Fetch a single Service Binding
447448
@@ -475,7 +476,7 @@ async def get(
475476
timeout=timeout,
476477
post_parser=ResultWrapper._unwrapper,
477478
),
478-
cast_to=cast(Type[AddressingServiceBinding], ResultWrapper[AddressingServiceBinding]),
479+
cast_to=cast(Type[BindingGetResponse], ResultWrapper[BindingGetResponse]),
479480
)
480481

481482

src/cloudflare/resources/addressing/prefixes/bgp/prefixes.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323
from ....._base_client import (
2424
make_request_options,
2525
)
26-
from .....types.addressing.prefixes.bgp import PrefixListResponse, AddressingIpamBGPPrefixes, prefix_edit_params
26+
from .....types.addressing.prefixes.bgp import (
27+
PrefixGetResponse,
28+
PrefixEditResponse,
29+
PrefixListResponse,
30+
prefix_edit_params,
31+
)
2732

2833
__all__ = ["Prefixes", "AsyncPrefixes"]
2934

@@ -98,7 +103,7 @@ def edit(
98103
extra_query: Query | None = None,
99104
extra_body: Body | None = None,
100105
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
101-
) -> AddressingIpamBGPPrefixes:
106+
) -> PrefixEditResponse:
102107
"""
103108
Update the properties of a BGP Prefix, such as the on demand advertisement
104109
status (advertised or withdrawn).
@@ -134,7 +139,7 @@ def edit(
134139
timeout=timeout,
135140
post_parser=ResultWrapper._unwrapper,
136141
),
137-
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
142+
cast_to=cast(Type[PrefixEditResponse], ResultWrapper[PrefixEditResponse]),
138143
)
139144

140145
def get(
@@ -149,7 +154,7 @@ def get(
149154
extra_query: Query | None = None,
150155
extra_body: Body | None = None,
151156
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
152-
) -> AddressingIpamBGPPrefixes:
157+
) -> PrefixGetResponse:
153158
"""
154159
Retrieve a single BGP Prefix according to its identifier
155160
@@ -183,7 +188,7 @@ def get(
183188
timeout=timeout,
184189
post_parser=ResultWrapper._unwrapper,
185190
),
186-
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
191+
cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]),
187192
)
188193

189194

@@ -257,7 +262,7 @@ async def edit(
257262
extra_query: Query | None = None,
258263
extra_body: Body | None = None,
259264
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
260-
) -> AddressingIpamBGPPrefixes:
265+
) -> PrefixEditResponse:
261266
"""
262267
Update the properties of a BGP Prefix, such as the on demand advertisement
263268
status (advertised or withdrawn).
@@ -293,7 +298,7 @@ async def edit(
293298
timeout=timeout,
294299
post_parser=ResultWrapper._unwrapper,
295300
),
296-
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
301+
cast_to=cast(Type[PrefixEditResponse], ResultWrapper[PrefixEditResponse]),
297302
)
298303

299304
async def get(
@@ -308,7 +313,7 @@ async def get(
308313
extra_query: Query | None = None,
309314
extra_body: Body | None = None,
310315
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
311-
) -> AddressingIpamBGPPrefixes:
316+
) -> PrefixGetResponse:
312317
"""
313318
Retrieve a single BGP Prefix according to its identifier
314319
@@ -342,7 +347,7 @@ async def get(
342347
timeout=timeout,
343348
post_parser=ResultWrapper._unwrapper,
344349
),
345-
cast_to=cast(Type[AddressingIpamBGPPrefixes], ResultWrapper[AddressingIpamBGPPrefixes]),
350+
cast_to=cast(Type[PrefixGetResponse], ResultWrapper[PrefixGetResponse]),
346351
)
347352

348353

src/cloudflare/resources/addressing/prefixes/delegations.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
)
2626
from ....types.addressing.prefixes import (
2727
DelegationListResponse,
28+
DelegationCreateResponse,
2829
DelegationDeleteResponse,
29-
AddressingIpamDelegations,
3030
delegation_create_params,
3131
)
3232

@@ -55,7 +55,7 @@ def create(
5555
extra_query: Query | None = None,
5656
extra_body: Body | None = None,
5757
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58-
) -> AddressingIpamDelegations:
58+
) -> DelegationCreateResponse:
5959
"""
6060
Create a new account delegation for a given IP prefix.
6161
@@ -96,7 +96,7 @@ def create(
9696
timeout=timeout,
9797
post_parser=ResultWrapper._unwrapper,
9898
),
99-
cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]),
99+
cast_to=cast(Type[DelegationCreateResponse], ResultWrapper[DelegationCreateResponse]),
100100
)
101101

102102
def list(
@@ -215,7 +215,7 @@ async def create(
215215
extra_query: Query | None = None,
216216
extra_body: Body | None = None,
217217
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
218-
) -> AddressingIpamDelegations:
218+
) -> DelegationCreateResponse:
219219
"""
220220
Create a new account delegation for a given IP prefix.
221221
@@ -256,7 +256,7 @@ async def create(
256256
timeout=timeout,
257257
post_parser=ResultWrapper._unwrapper,
258258
),
259-
cast_to=cast(Type[AddressingIpamDelegations], ResultWrapper[AddressingIpamDelegations]),
259+
cast_to=cast(Type[DelegationCreateResponse], ResultWrapper[DelegationCreateResponse]),
260260
)
261261

262262
async def list(

0 commit comments

Comments
 (0)