Skip to content

Commit bcfd50b

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#383)
1 parent 271a315 commit bcfd50b

File tree

13 files changed

+102
-102
lines changed

13 files changed

+102
-102
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1259
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f0167c5fee5c0cadf72c222f47f8fc3ba43905607b21f6a88853c061117b77b.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-543a9898a4efc4501e7101d78908dcfaa303efd8f2abb7164299dd85be87749d.yml

api.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3409,8 +3409,8 @@ from cloudflare.types.brand_protection import (
34093409

34103410
Methods:
34113411

3412-
- <code title="post /accounts/{account_id}/brand-protection/submit">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">submit</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_submit_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/submit.py">Submit</a></code>
3413-
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">url_info</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_url_info_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/info.py">Info</a></code>
3412+
- <code title="post /accounts/{account_id}/brand-protection/submit">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">submit</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_submit_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/submit.py">Optional</a></code>
3413+
- <code title="get /accounts/{account_id}/brand-protection/url-info">client.brand_protection.<a href="./src/cloudflare/resources/brand_protection.py">url_info</a>(\*, account_id, \*\*<a href="src/cloudflare/types/brand_protection/brand_protection_url_info_params.py">params</a>) -> <a href="./src/cloudflare/types/brand_protection/info.py">Optional</a></code>
34143414

34153415
# Diagnostics
34163416

@@ -3528,7 +3528,7 @@ Methods:
35283528

35293529
Methods:
35303530

3531-
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/shared/asn.py">ASN</a></code>
3531+
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.intel.asn.<a href="./src/cloudflare/resources/intel/asn/asn.py">get</a>(asn, \*, account_id) -> <a href="./src/cloudflare/types/shared/asn.py">Optional</a></code>
35323532

35333533
### Subnets
35343534

@@ -3564,7 +3564,7 @@ from cloudflare.types.intel import Domain
35643564

35653565
Methods:
35663566

3567-
- <code title="get /accounts/{account_id}/intel/domain">client.intel.domains.<a href="./src/cloudflare/resources/intel/domains/domains.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/domain_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/domain.py">Domain</a></code>
3567+
- <code title="get /accounts/{account_id}/intel/domain">client.intel.domains.<a href="./src/cloudflare/resources/intel/domains/domains.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/domain_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/domain.py">Optional</a></code>
35683568

35693569
### Bulks
35703570

@@ -3624,7 +3624,7 @@ from cloudflare.types.intel import MiscategorizationCreateResponse
36243624

36253625
Methods:
36263626

3627-
- <code title="post /accounts/{account_id}/intel/miscategorization">client.intel.miscategorizations.<a href="./src/cloudflare/resources/intel/miscategorizations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/miscategorization_create_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/miscategorization_create_response.py">MiscategorizationCreateResponse</a></code>
3627+
- <code title="post /accounts/{account_id}/intel/miscategorization">client.intel.miscategorizations.<a href="./src/cloudflare/resources/intel/miscategorizations.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/miscategorization_create_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/miscategorization_create_response.py">Optional</a></code>
36283628

36293629
## Whois
36303630

@@ -3636,7 +3636,7 @@ from cloudflare.types.intel import Whois
36363636

36373637
Methods:
36383638

3639-
- <code title="get /accounts/{account_id}/intel/whois">client.intel.whois.<a href="./src/cloudflare/resources/intel/whois.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/whois_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/whois.py">Whois</a></code>
3639+
- <code title="get /accounts/{account_id}/intel/whois">client.intel.whois.<a href="./src/cloudflare/resources/intel/whois.py">get</a>(\*, account_id, \*\*<a href="src/cloudflare/types/intel/whois_get_params.py">params</a>) -> <a href="./src/cloudflare/types/intel/whois.py">Optional</a></code>
36403640

36413641
## IndicatorFeeds
36423642

src/cloudflare/resources/brand_protection.py

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

33
from __future__ import annotations
44

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

77
import httpx
88

@@ -50,7 +50,7 @@ def submit(
5050
extra_query: Query | None = None,
5151
extra_body: Body | None = None,
5252
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53-
) -> Submit:
53+
) -> Optional[Submit]:
5454
"""
5555
Submit suspicious URL for scanning
5656
@@ -77,9 +77,9 @@ def submit(
7777
extra_query=extra_query,
7878
extra_body=extra_body,
7979
timeout=timeout,
80-
post_parser=ResultWrapper[Submit]._unwrapper,
80+
post_parser=ResultWrapper[Optional[Submit]]._unwrapper,
8181
),
82-
cast_to=cast(Type[Submit], ResultWrapper[Submit]),
82+
cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]),
8383
)
8484

8585
def url_info(
@@ -94,7 +94,7 @@ def url_info(
9494
extra_query: Query | None = None,
9595
extra_body: Body | None = None,
9696
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
97-
) -> Info:
97+
) -> Optional[Info]:
9898
"""
9999
Get results for a URL scan
100100
@@ -125,9 +125,9 @@ def url_info(
125125
},
126126
brand_protection_url_info_params.BrandProtectionURLInfoParams,
127127
),
128-
post_parser=ResultWrapper[Info]._unwrapper,
128+
post_parser=ResultWrapper[Optional[Info]]._unwrapper,
129129
),
130-
cast_to=cast(Type[Info], ResultWrapper[Info]),
130+
cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]),
131131
)
132132

133133

@@ -151,7 +151,7 @@ async def submit(
151151
extra_query: Query | None = None,
152152
extra_body: Body | None = None,
153153
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
154-
) -> Submit:
154+
) -> Optional[Submit]:
155155
"""
156156
Submit suspicious URL for scanning
157157
@@ -178,9 +178,9 @@ async def submit(
178178
extra_query=extra_query,
179179
extra_body=extra_body,
180180
timeout=timeout,
181-
post_parser=ResultWrapper[Submit]._unwrapper,
181+
post_parser=ResultWrapper[Optional[Submit]]._unwrapper,
182182
),
183-
cast_to=cast(Type[Submit], ResultWrapper[Submit]),
183+
cast_to=cast(Type[Optional[Submit]], ResultWrapper[Submit]),
184184
)
185185

186186
async def url_info(
@@ -195,7 +195,7 @@ async def url_info(
195195
extra_query: Query | None = None,
196196
extra_body: Body | None = None,
197197
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
198-
) -> Info:
198+
) -> Optional[Info]:
199199
"""
200200
Get results for a URL scan
201201
@@ -226,9 +226,9 @@ async def url_info(
226226
},
227227
brand_protection_url_info_params.BrandProtectionURLInfoParams,
228228
),
229-
post_parser=ResultWrapper[Info]._unwrapper,
229+
post_parser=ResultWrapper[Optional[Info]]._unwrapper,
230230
),
231-
cast_to=cast(Type[Info], ResultWrapper[Info]),
231+
cast_to=cast(Type[Optional[Info]], ResultWrapper[Info]),
232232
)
233233

234234

src/cloudflare/resources/intel/asn/asn.py

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

33
from __future__ import annotations
44

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

77
import httpx
88

@@ -56,7 +56,7 @@ def get(
5656
extra_query: Query | None = None,
5757
extra_body: Body | None = None,
5858
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59-
) -> ASN:
59+
) -> Optional[ASN]:
6060
"""
6161
Get ASN Overview
6262
@@ -80,9 +80,9 @@ def get(
8080
extra_query=extra_query,
8181
extra_body=extra_body,
8282
timeout=timeout,
83-
post_parser=ResultWrapper[ASN]._unwrapper,
83+
post_parser=ResultWrapper[Optional[ASN]]._unwrapper,
8484
),
85-
cast_to=cast(Type[ASN], ResultWrapper[int]),
85+
cast_to=cast(Type[Optional[ASN]], ResultWrapper[int]),
8686
)
8787

8888

@@ -110,7 +110,7 @@ async def get(
110110
extra_query: Query | None = None,
111111
extra_body: Body | None = None,
112112
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
113-
) -> ASN:
113+
) -> Optional[ASN]:
114114
"""
115115
Get ASN Overview
116116
@@ -134,9 +134,9 @@ async def get(
134134
extra_query=extra_query,
135135
extra_body=extra_body,
136136
timeout=timeout,
137-
post_parser=ResultWrapper[ASN]._unwrapper,
137+
post_parser=ResultWrapper[Optional[ASN]]._unwrapper,
138138
),
139-
cast_to=cast(Type[ASN], ResultWrapper[int]),
139+
cast_to=cast(Type[Optional[ASN]], ResultWrapper[int]),
140140
)
141141

142142

src/cloudflare/resources/intel/domains/domains.py

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

33
from __future__ import annotations
44

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

77
import httpx
88

@@ -61,7 +61,7 @@ def get(
6161
extra_query: Query | None = None,
6262
extra_body: Body | None = None,
6363
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
64-
) -> Domain:
64+
) -> Optional[Domain]:
6565
"""
6666
Get Domain Details
6767
@@ -86,9 +86,9 @@ def get(
8686
extra_body=extra_body,
8787
timeout=timeout,
8888
query=maybe_transform({"domain": domain}, domain_get_params.DomainGetParams),
89-
post_parser=ResultWrapper[Domain]._unwrapper,
89+
post_parser=ResultWrapper[Optional[Domain]]._unwrapper,
9090
),
91-
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
91+
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
9292
)
9393

9494

@@ -116,7 +116,7 @@ async def get(
116116
extra_query: Query | None = None,
117117
extra_body: Body | None = None,
118118
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
119-
) -> Domain:
119+
) -> Optional[Domain]:
120120
"""
121121
Get Domain Details
122122
@@ -141,9 +141,9 @@ async def get(
141141
extra_body=extra_body,
142142
timeout=timeout,
143143
query=await async_maybe_transform({"domain": domain}, domain_get_params.DomainGetParams),
144-
post_parser=ResultWrapper[Domain]._unwrapper,
144+
post_parser=ResultWrapper[Optional[Domain]]._unwrapper,
145145
),
146-
cast_to=cast(Type[Domain], ResultWrapper[Domain]),
146+
cast_to=cast(Type[Optional[Domain]], ResultWrapper[Domain]),
147147
)
148148

149149

src/cloudflare/resources/intel/miscategorizations.py

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

33
from __future__ import annotations
44

5-
from typing import Any, Iterable, cast
5+
from typing import Any, Iterable, Optional, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -56,7 +56,7 @@ def create(
5656
extra_query: Query | None = None,
5757
extra_body: Body | None = None,
5858
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
59-
) -> MiscategorizationCreateResponse:
59+
) -> Optional[MiscategorizationCreateResponse]:
6060
"""
6161
Create Miscategorization
6262
@@ -88,7 +88,7 @@ def create(
8888
if not account_id:
8989
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
9090
return cast(
91-
MiscategorizationCreateResponse,
91+
Optional[MiscategorizationCreateResponse],
9292
self._post(
9393
f"/accounts/{account_id}/intel/miscategorization",
9494
body=maybe_transform(
@@ -108,7 +108,7 @@ def create(
108108
extra_query=extra_query,
109109
extra_body=extra_body,
110110
timeout=timeout,
111-
post_parser=ResultWrapper[MiscategorizationCreateResponse]._unwrapper,
111+
post_parser=ResultWrapper[Optional[MiscategorizationCreateResponse]]._unwrapper,
112112
),
113113
cast_to=cast(
114114
Any, ResultWrapper[MiscategorizationCreateResponse]
@@ -143,7 +143,7 @@ async def create(
143143
extra_query: Query | None = None,
144144
extra_body: Body | None = None,
145145
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
146-
) -> MiscategorizationCreateResponse:
146+
) -> Optional[MiscategorizationCreateResponse]:
147147
"""
148148
Create Miscategorization
149149
@@ -175,7 +175,7 @@ async def create(
175175
if not account_id:
176176
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
177177
return cast(
178-
MiscategorizationCreateResponse,
178+
Optional[MiscategorizationCreateResponse],
179179
await self._post(
180180
f"/accounts/{account_id}/intel/miscategorization",
181181
body=await async_maybe_transform(
@@ -195,7 +195,7 @@ async def create(
195195
extra_query=extra_query,
196196
extra_body=extra_body,
197197
timeout=timeout,
198-
post_parser=ResultWrapper[MiscategorizationCreateResponse]._unwrapper,
198+
post_parser=ResultWrapper[Optional[MiscategorizationCreateResponse]]._unwrapper,
199199
),
200200
cast_to=cast(
201201
Any, ResultWrapper[MiscategorizationCreateResponse]

src/cloudflare/resources/intel/whois.py

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

33
from __future__ import annotations
44

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

77
import httpx
88

@@ -49,7 +49,7 @@ def get(
4949
extra_query: Query | None = None,
5050
extra_body: Body | None = None,
5151
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52-
) -> Whois:
52+
) -> Optional[Whois]:
5353
"""
5454
Get WHOIS Record
5555
@@ -74,9 +74,9 @@ def get(
7474
extra_body=extra_body,
7575
timeout=timeout,
7676
query=maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
77-
post_parser=ResultWrapper[Whois]._unwrapper,
77+
post_parser=ResultWrapper[Optional[Whois]]._unwrapper,
7878
),
79-
cast_to=cast(Type[Whois], ResultWrapper[Whois]),
79+
cast_to=cast(Type[Optional[Whois]], ResultWrapper[Whois]),
8080
)
8181

8282

@@ -100,7 +100,7 @@ async def get(
100100
extra_query: Query | None = None,
101101
extra_body: Body | None = None,
102102
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
103-
) -> Whois:
103+
) -> Optional[Whois]:
104104
"""
105105
Get WHOIS Record
106106
@@ -125,9 +125,9 @@ async def get(
125125
extra_body=extra_body,
126126
timeout=timeout,
127127
query=await async_maybe_transform({"domain": domain}, whois_get_params.WhoisGetParams),
128-
post_parser=ResultWrapper[Whois]._unwrapper,
128+
post_parser=ResultWrapper[Optional[Whois]]._unwrapper,
129129
),
130-
cast_to=cast(Type[Whois], ResultWrapper[Whois]),
130+
cast_to=cast(Type[Optional[Whois]], ResultWrapper[Whois]),
131131
)
132132

133133

src/cloudflare/types/intel/dns_list_response.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

66
from .dns import DNS
@@ -15,7 +15,7 @@ class DNSListResponse(BaseModel):
1515

1616
messages: List[ResponseInfo]
1717

18-
result: DNS
19-
2018
success: Literal[True]
2119
"""Whether the API call was successful"""
20+
21+
result: Optional[DNS] = None

0 commit comments

Comments
 (0)