Skip to content

Commit 7d5572a

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#1021)
1 parent 8e20edf commit 7d5572a

File tree

14 files changed

+183
-29
lines changed

14 files changed

+183
-29
lines changed

.stats.yml

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

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6079,7 +6079,7 @@ Methods:
60796079

60806080
- <code title="post /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/list_create_response.py">Optional</a></code>
60816081
- <code title="put /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">update</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>
6082-
- <code title="get /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">SyncSinglePage[GatewayList]</a></code>
6082+
- <code title="get /accounts/{account_id}/gateway/lists">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_list_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">SyncSinglePage[GatewayList]</a></code>
60836083
- <code title="delete /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">delete</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/list_delete_response.py">Optional</a></code>
60846084
- <code title="patch /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">edit</a>(list_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/gateway/list_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>
60856085
- <code title="get /accounts/{account_id}/gateway/lists/{list_id}">client.zero_trust.gateway.lists.<a href="./src/cloudflare/resources/zero_trust/gateway/lists/lists.py">get</a>(list_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/gateway_list.py">Optional</a></code>

src/cloudflare/resources/zero_trust/gateway/configurations.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def edit(
102102
This endpoint can update a
103103
single subcollection of settings such as `antivirus`, `tls_decrypt`,
104104
`activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
105-
`custom_certificate`, without updating the entire configuration object. Returns
106-
an error if any collection of settings is not properly configured.
105+
`certificate`, without updating the entire configuration object. Returns an
106+
error if any collection of settings is not properly configured.
107107
108108
Args:
109109
settings: account settings.
@@ -238,8 +238,8 @@ async def edit(
238238
This endpoint can update a
239239
single subcollection of settings such as `antivirus`, `tls_decrypt`,
240240
`activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, or
241-
`custom_certificate`, without updating the entire configuration object. Returns
242-
an error if any collection of settings is not properly configured.
241+
`certificate`, without updating the entire configuration object. Returns an
242+
error if any collection of settings is not properly configured.
243243
244244
Args:
245245
settings: account settings.

src/cloudflare/resources/zero_trust/gateway/lists/lists.py

+17-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
AsyncPaginator,
3535
make_request_options,
3636
)
37-
from .....types.zero_trust.gateway import list_edit_params, list_create_params, list_update_params
37+
from .....types.zero_trust.gateway import list_edit_params, list_list_params, list_create_params, list_update_params
3838
from .....types.zero_trust.gateway.gateway_list import GatewayList
3939
from .....types.zero_trust.gateway.gateway_item_param import GatewayItemParam
4040
from .....types.zero_trust.gateway.list_create_response import ListCreateResponse
@@ -173,6 +173,7 @@ def list(
173173
self,
174174
*,
175175
account_id: str,
176+
type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | NotGiven = NOT_GIVEN,
176177
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
177178
# The extra values given here take precedence over values defined on the client or passed to this method.
178179
extra_headers: Headers | None = None,
@@ -184,6 +185,8 @@ def list(
184185
Fetches all Zero Trust lists for an account.
185186
186187
Args:
188+
type: The type of list.
189+
187190
extra_headers: Send extra headers
188191
189192
extra_query: Add additional query parameters to the request
@@ -198,7 +201,11 @@ def list(
198201
f"/accounts/{account_id}/gateway/lists",
199202
page=SyncSinglePage[GatewayList],
200203
options=make_request_options(
201-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
204+
extra_headers=extra_headers,
205+
extra_query=extra_query,
206+
extra_body=extra_body,
207+
timeout=timeout,
208+
query=maybe_transform({"type": type}, list_list_params.ListListParams),
202209
),
203210
model=GatewayList,
204211
)
@@ -478,6 +485,7 @@ def list(
478485
self,
479486
*,
480487
account_id: str,
488+
type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"] | NotGiven = NOT_GIVEN,
481489
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
482490
# The extra values given here take precedence over values defined on the client or passed to this method.
483491
extra_headers: Headers | None = None,
@@ -489,6 +497,8 @@ def list(
489497
Fetches all Zero Trust lists for an account.
490498
491499
Args:
500+
type: The type of list.
501+
492502
extra_headers: Send extra headers
493503
494504
extra_query: Add additional query parameters to the request
@@ -503,7 +513,11 @@ def list(
503513
f"/accounts/{account_id}/gateway/lists",
504514
page=AsyncSinglePage[GatewayList],
505515
options=make_request_options(
506-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
516+
extra_headers=extra_headers,
517+
extra_query=extra_query,
518+
extra_body=extra_body,
519+
timeout=timeout,
520+
query=maybe_transform({"type": type}, list_list_params.ListListParams),
507521
),
508522
model=GatewayList,
509523
)

src/cloudflare/types/zero_trust/gateway/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .logging_setting import LoggingSetting as LoggingSetting
2020
from .gateway_settings import GatewaySettings as GatewaySettings
2121
from .list_edit_params import ListEditParams as ListEditParams
22+
from .list_list_params import ListListParams as ListListParams
2223
from .location_network import LocationNetwork as LocationNetwork
2324
from .gateway_item_param import GatewayItemParam as GatewayItemParam
2425
from .list_create_params import ListCreateParams as ListCreateParams

src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings.py

+16-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
from .browser_isolation_settings import BrowserIsolationSettings
1515
from .custom_certificate_settings import CustomCertificateSettings
1616

17-
__all__ = ["GatewayConfigurationSettings"]
17+
__all__ = ["GatewayConfigurationSettings", "Certificate"]
18+
19+
20+
class Certificate(BaseModel):
21+
id: str
22+
"""UUID of certificate to be used for interception."""
1823

1924

2025
class GatewayConfigurationSettings(BaseModel):
@@ -33,8 +38,17 @@ class GatewayConfigurationSettings(BaseModel):
3338
browser_isolation: Optional[BrowserIsolationSettings] = None
3439
"""Browser isolation settings."""
3540

41+
certificate: Optional[Certificate] = None
42+
"""Certificate settings for Gateway TLS interception.
43+
44+
If not specified, the Cloudflare Root CA will be used.
45+
"""
46+
3647
custom_certificate: Optional[CustomCertificateSettings] = None
37-
"""Custom certificate settings for BYO-PKI."""
48+
"""Custom certificate settings for BYO-PKI.
49+
50+
(deprecated and replaced by `certificate`)
51+
"""
3852

3953
extended_email_matching: Optional[ExtendedEmailMatching] = None
4054
"""Extended e-mail matching settings."""

src/cloudflare/types/zero_trust/gateway/gateway_configuration_settings_param.py

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

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing_extensions import Required, TypedDict
66

77
from .tls_settings_param import TLSSettingsParam
88
from .fips_settings_param import FipsSettingsParam
@@ -15,7 +15,12 @@
1515
from .browser_isolation_settings_param import BrowserIsolationSettingsParam
1616
from .custom_certificate_settings_param import CustomCertificateSettingsParam
1717

18-
__all__ = ["GatewayConfigurationSettingsParam"]
18+
__all__ = ["GatewayConfigurationSettingsParam", "Certificate"]
19+
20+
21+
class Certificate(TypedDict, total=False):
22+
id: Required[str]
23+
"""UUID of certificate to be used for interception."""
1924

2025

2126
class GatewayConfigurationSettingsParam(TypedDict, total=False):
@@ -34,8 +39,17 @@ class GatewayConfigurationSettingsParam(TypedDict, total=False):
3439
browser_isolation: BrowserIsolationSettingsParam
3540
"""Browser isolation settings."""
3641

42+
certificate: Certificate
43+
"""Certificate settings for Gateway TLS interception.
44+
45+
If not specified, the Cloudflare Root CA will be used.
46+
"""
47+
3748
custom_certificate: CustomCertificateSettingsParam
38-
"""Custom certificate settings for BYO-PKI."""
49+
"""Custom certificate settings for BYO-PKI.
50+
51+
(deprecated and replaced by `certificate`)
52+
"""
3953

4054
extended_email_matching: ExtendedEmailMatchingParam
4155
"""Extended e-mail matching settings."""

src/cloudflare/types/zero_trust/gateway/gateway_item_param.py

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

33
from __future__ import annotations
44

5-
from typing_extensions import TypedDict
5+
from typing import Union
6+
from datetime import datetime
7+
from typing_extensions import Annotated, TypedDict
8+
9+
from ...._utils import PropertyInfo
610

711
__all__ = ["GatewayItemParam"]
812

913

1014
class GatewayItemParam(TypedDict, total=False):
15+
created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
16+
1117
value: str
1218
"""The value of the item in a list."""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, Required, TypedDict
6+
7+
__all__ = ["ListListParams"]
8+
9+
10+
class ListListParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
13+
type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP"]
14+
"""The type of list."""

src/cloudflare/types/zero_trust/gateway/rule_setting.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ class AuditSSH(BaseModel):
2828

2929
class BisoAdminControls(BaseModel):
3030
dcp: Optional[bool] = None
31-
"""Set to true to enable copy-pasting."""
31+
"""Set to false to enable copy-pasting."""
3232

3333
dd: Optional[bool] = None
34-
"""Set to true to enable downloading."""
34+
"""Set to false to enable downloading."""
3535

3636
dk: Optional[bool] = None
37-
"""Set to true to enable keyboard usage."""
37+
"""Set to false to enable keyboard usage."""
3838

3939
dp: Optional[bool] = None
40-
"""Set to true to enable printing."""
40+
"""Set to false to enable printing."""
4141

4242
du: Optional[bool] = None
43-
"""Set to true to enable uploading."""
43+
"""Set to false to enable uploading."""
4444

4545

4646
class CheckSession(BaseModel):
@@ -153,6 +153,13 @@ class RuleSetting(BaseModel):
153153
it to indicate local egress via WARP IPs.
154154
"""
155155

156+
ignore_cname_category_matches: Optional[bool] = None
157+
"""Set to true, to ignore the category matches at CNAME domains in a response.
158+
159+
If unchecked, the categories in this rule will be checked against all the CNAME
160+
domain categories in a response.
161+
"""
162+
156163
insecure_disable_dnssec_validation: Optional[bool] = None
157164
"""INSECURE - disable DNSSEC validation (for Allow actions)."""
158165

src/cloudflare/types/zero_trust/gateway/rule_setting_param.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ class AuditSSH(TypedDict, total=False):
2929

3030
class BisoAdminControls(TypedDict, total=False):
3131
dcp: bool
32-
"""Set to true to enable copy-pasting."""
32+
"""Set to false to enable copy-pasting."""
3333

3434
dd: bool
35-
"""Set to true to enable downloading."""
35+
"""Set to false to enable downloading."""
3636

3737
dk: bool
38-
"""Set to true to enable keyboard usage."""
38+
"""Set to false to enable keyboard usage."""
3939

4040
dp: bool
41-
"""Set to true to enable printing."""
41+
"""Set to false to enable printing."""
4242

4343
du: bool
44-
"""Set to true to enable uploading."""
44+
"""Set to false to enable uploading."""
4545

4646

4747
class CheckSession(TypedDict, total=False):
@@ -154,6 +154,13 @@ class RuleSettingParam(TypedDict, total=False):
154154
it to indicate local egress via WARP IPs.
155155
"""
156156

157+
ignore_cname_category_matches: bool
158+
"""Set to true, to ignore the category matches at CNAME domains in a response.
159+
160+
If unchecked, the categories in this rule will be checked against all the CNAME
161+
domain categories in a response.
162+
"""
163+
157164
insecure_disable_dnssec_validation: bool
158165
"""INSECURE - disable DNSSEC validation (for Allow actions)."""
159166

tests/api_resources/zero_trust/gateway/test_configurations.py

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
6060
"non_identity_enabled": True,
6161
"url_browser_isolation_enabled": True,
6262
},
63+
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
6364
"custom_certificate": {
6465
"enabled": True,
6566
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
@@ -142,6 +143,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
142143
"non_identity_enabled": True,
143144
"url_browser_isolation_enabled": True,
144145
},
146+
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
145147
"custom_certificate": {
146148
"enabled": True,
147149
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
@@ -266,6 +268,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
266268
"non_identity_enabled": True,
267269
"url_browser_isolation_enabled": True,
268270
},
271+
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
269272
"custom_certificate": {
270273
"enabled": True,
271274
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",
@@ -348,6 +351,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
348351
"non_identity_enabled": True,
349352
"url_browser_isolation_enabled": True,
350353
},
354+
"certificate": {"id": "d1b364c5-1311-466e-a194-f0e943e0799f"},
351355
"custom_certificate": {
352356
"enabled": True,
353357
"id": "d1b364c5-1311-466e-a194-f0e943e0799f",

0 commit comments

Comments
 (0)