Skip to content

Commit fdbc41b

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#880)
1 parent 017c740 commit fdbc41b

File tree

9 files changed

+165
-56
lines changed

9 files changed

+165
-56
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1343
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0053e474edb7f838f2b1d38334a7ccb983db09216cca0173a3c3d5401cadcf82.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d780b9eb98465e97c30112eb2c9e586883852508d23a6684bd28e5a9cb7da7a1.yml

api.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -3498,15 +3498,9 @@ Methods:
34983498

34993499
### Downloads
35003500

3501-
Types:
3502-
3503-
```python
3504-
from cloudflare.types.addressing.loa_documents import DownloadGetResponse
3505-
```
3506-
35073501
Methods:
35083502

3509-
- <code title="get /accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download">client.addressing.loa_documents.downloads.<a href="./src/cloudflare/resources/addressing/loa_documents/downloads.py">get</a>(loa_document_id, \*, account_id) -> <a href="./src/cloudflare/types/addressing/loa_documents/download_get_response.py">object</a></code>
3503+
- <code title="get /accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download">client.addressing.loa_documents.downloads.<a href="./src/cloudflare/resources/addressing/loa_documents/downloads.py">get</a>(loa_document_id, \*, account_id) -> BinaryAPIResponse</code>
35103504

35113505
## Prefixes
35123506

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

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, Optional, cast
5+
from typing import List, Type, Iterable, Optional, cast
66

77
import httpx
88

@@ -85,6 +85,8 @@ def create(
8585
account_id: str,
8686
description: Optional[str] | NotGiven = NOT_GIVEN,
8787
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
88+
ips: List[str] | NotGiven = NOT_GIVEN,
89+
memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN,
8890
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8991
# The extra values given here take precedence over values defined on the client or passed to this method.
9092
extra_headers: Headers | None = None,
@@ -104,6 +106,9 @@ def create(
104106
enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
105107
with IP addresses on an Address Map until the map is enabled.
106108
109+
memberships: Zones and Accounts which will be assigned IPs on this Address Map. A zone
110+
membership will take priority over an account membership.
111+
107112
extra_headers: Send extra headers
108113
109114
extra_query: Add additional query parameters to the request
@@ -120,6 +125,8 @@ def create(
120125
{
121126
"description": description,
122127
"enabled": enabled,
128+
"ips": ips,
129+
"memberships": memberships,
123130
},
124131
address_map_create_params.AddressMapCreateParams,
125132
),
@@ -354,6 +361,8 @@ async def create(
354361
account_id: str,
355362
description: Optional[str] | NotGiven = NOT_GIVEN,
356363
enabled: Optional[bool] | NotGiven = NOT_GIVEN,
364+
ips: List[str] | NotGiven = NOT_GIVEN,
365+
memberships: Iterable[address_map_create_params.Membership] | NotGiven = NOT_GIVEN,
357366
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
358367
# The extra values given here take precedence over values defined on the client or passed to this method.
359368
extra_headers: Headers | None = None,
@@ -373,6 +382,9 @@ async def create(
373382
enabled: Whether the Address Map is enabled or not. Cloudflare's DNS will not respond
374383
with IP addresses on an Address Map until the map is enabled.
375384
385+
memberships: Zones and Accounts which will be assigned IPs on this Address Map. A zone
386+
membership will take priority over an account membership.
387+
376388
extra_headers: Send extra headers
377389
378390
extra_query: Add additional query parameters to the request
@@ -389,6 +401,8 @@ async def create(
389401
{
390402
"description": description,
391403
"enabled": enabled,
404+
"ips": ips,
405+
"memberships": memberships,
392406
},
393407
address_map_create_params.AddressMapCreateParams,
394408
),

src/cloudflare/resources/addressing/loa_documents/downloads.py

+22-12
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
from ...._compat import cached_property
1111
from ...._resource import SyncAPIResource, AsyncAPIResource
1212
from ...._response import (
13-
to_raw_response_wrapper,
14-
to_streamed_response_wrapper,
15-
async_to_raw_response_wrapper,
16-
async_to_streamed_response_wrapper,
13+
BinaryAPIResponse,
14+
AsyncBinaryAPIResponse,
15+
StreamedBinaryAPIResponse,
16+
AsyncStreamedBinaryAPIResponse,
17+
to_custom_raw_response_wrapper,
18+
to_custom_streamed_response_wrapper,
19+
async_to_custom_raw_response_wrapper,
20+
async_to_custom_streamed_response_wrapper,
1721
)
1822
from ...._base_client import (
1923
make_request_options,
@@ -42,7 +46,7 @@ def get(
4246
extra_query: Query | None = None,
4347
extra_body: Body | None = None,
4448
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
45-
) -> object:
49+
) -> BinaryAPIResponse:
4650
"""
4751
Download specified LOA document under the account.
4852
@@ -63,12 +67,13 @@ def get(
6367
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
6468
if not loa_document_id:
6569
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
70+
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
6671
return self._get(
6772
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
6873
options=make_request_options(
6974
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
7075
),
71-
cast_to=object,
76+
cast_to=BinaryAPIResponse,
7277
)
7378

7479

@@ -92,7 +97,7 @@ async def get(
9297
extra_query: Query | None = None,
9398
extra_body: Body | None = None,
9499
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
95-
) -> object:
100+
) -> AsyncBinaryAPIResponse:
96101
"""
97102
Download specified LOA document under the account.
98103
@@ -113,46 +118,51 @@ async def get(
113118
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
114119
if not loa_document_id:
115120
raise ValueError(f"Expected a non-empty value for `loa_document_id` but received {loa_document_id!r}")
121+
extra_headers = {"Accept": "application/pdf", **(extra_headers or {})}
116122
return await self._get(
117123
f"/accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download",
118124
options=make_request_options(
119125
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
120126
),
121-
cast_to=object,
127+
cast_to=AsyncBinaryAPIResponse,
122128
)
123129

124130

125131
class DownloadsResourceWithRawResponse:
126132
def __init__(self, downloads: DownloadsResource) -> None:
127133
self._downloads = downloads
128134

129-
self.get = to_raw_response_wrapper(
135+
self.get = to_custom_raw_response_wrapper(
130136
downloads.get,
137+
BinaryAPIResponse,
131138
)
132139

133140

134141
class AsyncDownloadsResourceWithRawResponse:
135142
def __init__(self, downloads: AsyncDownloadsResource) -> None:
136143
self._downloads = downloads
137144

138-
self.get = async_to_raw_response_wrapper(
145+
self.get = async_to_custom_raw_response_wrapper(
139146
downloads.get,
147+
AsyncBinaryAPIResponse,
140148
)
141149

142150

143151
class DownloadsResourceWithStreamingResponse:
144152
def __init__(self, downloads: DownloadsResource) -> None:
145153
self._downloads = downloads
146154

147-
self.get = to_streamed_response_wrapper(
155+
self.get = to_custom_streamed_response_wrapper(
148156
downloads.get,
157+
StreamedBinaryAPIResponse,
149158
)
150159

151160

152161
class AsyncDownloadsResourceWithStreamingResponse:
153162
def __init__(self, downloads: AsyncDownloadsResource) -> None:
154163
self._downloads = downloads
155164

156-
self.get = async_to_streamed_response_wrapper(
165+
self.get = async_to_custom_streamed_response_wrapper(
157166
downloads.get,
167+
AsyncStreamedBinaryAPIResponse,
158168
)

src/cloudflare/types/addressing/address_map_create_params.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import List, Iterable, Optional
66
from typing_extensions import Required, TypedDict
77

8-
__all__ = ["AddressMapCreateParams"]
8+
from .kind import Kind
9+
10+
__all__ = ["AddressMapCreateParams", "Membership"]
911

1012

1113
class AddressMapCreateParams(TypedDict, total=False):
@@ -24,3 +26,19 @@ class AddressMapCreateParams(TypedDict, total=False):
2426
Cloudflare's DNS will not respond with IP addresses on an Address Map until the
2527
map is enabled.
2628
"""
29+
30+
ips: List[str]
31+
32+
memberships: Iterable[Membership]
33+
"""Zones and Accounts which will be assigned IPs on this Address Map.
34+
35+
A zone membership will take priority over an account membership.
36+
"""
37+
38+
39+
class Membership(TypedDict, total=False):
40+
identifier: str
41+
"""The identifier for the membership (eg. a zone or account tag)."""
42+
43+
kind: Kind
44+
"""The type of the membership."""

src/cloudflare/types/addressing/address_map_create_response.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Membership(BaseModel):
2323
created_at: Optional[datetime] = None
2424

2525
identifier: Optional[str] = None
26-
"""Identifier"""
26+
"""The identifier for the membership (eg. a zone or account tag)."""
2727

2828
kind: Optional[Kind] = None
2929
"""The type of the membership."""

src/cloudflare/types/addressing/address_map_get_response.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Membership(BaseModel):
2323
created_at: Optional[datetime] = None
2424

2525
identifier: Optional[str] = None
26-
"""Identifier"""
26+
"""The identifier for the membership (eg. a zone or account tag)."""
2727

2828
kind: Optional[Kind] = None
2929
"""The type of the membership."""

0 commit comments

Comments
 (0)