8000 feat(api): api update · cloudflare/cloudflare-python@ba2b47a · GitHub
[go: up one dir, main page]

Skip to content

Commit ba2b47a

Browse files
feat(api): api update
1 parent d04eeca commit ba2b47a

File tree

10 files changed

+59
-55
lines changed

10 files changed

+59
-55
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1706
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3a87ceefb94da2d80127b6c35317db34e4a0cc28e5c61127ce4d78f668f8eab3.yml
3-
openapi_spec_hash: 428f59533c0c251f6e8af6cb645d9155
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4284a52cf7801e15a7cdb55f187fcb9cd8ae5bb30b5c0a0ddc53053c8c05591a.yml
3+
openapi_spec_hash: f13817093ed6a667eb32d033a9e6b0ae
44
config_hash: 67f412c990647f3cb598378fa22a9db5

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6618,7 +6618,7 @@ Methods:
66186618

66196619
Methods:
66206620

6621-
- <code title="get /accounts/{account_id}/gateway/configuration/custom_certificate">client.zero_trust.gateway.configurations.custom_certificate.<a href="./src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py">get</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/custom_certificate_settings.py">CustomCertificateSettings</a></code>
6621+
- <code title="get /accounts/{account_id}/gateway/configuration/custom_certificate">client.zero_trust.gateway.configurations.custom_certificate.<a href="./src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py">get</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/gateway/custom_certificate_settings.py">Optional[CustomCertificateSettings]</a></code>
66226622

66236623
### Lists
66246624

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
6+
57
import httpx
68

79
from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -49,7 +51,7 @@ def get(
4951
extra_query: Query | None = None,
5052
extra_body: Body | None = None,
5153
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52-
) -> CustomCertificateSettings:
54+
) -> Optional[CustomCertificateSettings]:
5355
"""
5456
Fetches the current Zero Trust certificate configuration.
5557
@@ -103,7 +105,7 @@ async def get(
103105
extra_query: Query | None = None,
104106
extra_body: Body | None = None,
105107
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
106-
) -> CustomCertificateSettings:
108+
) -> Optional[CustomCertificateSettings]:
107109
"""
108110
Fetches the current Zero Trust certificate configuration.
109111

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ def create(
7575
description: str | NotGiven = NOT_GIVEN,
7676
device_posture: str | NotGiven = NOT_GIVEN,
7777
enabled: bool | NotGiven = NOT_GIVEN,
78-
expiration: rule_create_params.Expiration | NotGiven = NOT_GIVEN,
78+
expiration: Optional[rule_create_params.Expiration] | NotGiven = NOT_GIVEN,
7979
filters: List[GatewayFilter] | NotGiven = NOT_GIVEN,
8080
identity: str | NotGiven = NOT_GIVEN,
8181
precedence: int | NotGiven = NOT_GIVEN,
8282
rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN,
83-
schedule: ScheduleParam | NotGiven = NOT_GIVEN,
83+
schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN,
8484
traffic: str | NotGiven = NOT_GIVEN,
8585
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8686
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -191,12 +191,12 @@ def update(
191191
description: str | NotGiven = NOT_GIVEN,
192192
device_posture: str | NotGiven = NOT_GIVEN,
193193
enabled: bool | NotGiven = NOT_GIVEN,
194-
expiration: rule_update_params.Expiration | NotGiven = NOT_GIVEN,
194+
expiration: Optional[rule_update_params.Expiration] | NotGiven = NOT_GIVEN,
195195
filters: List[GatewayFilter] | NotGiven = NOT_GIVEN,
196196
identity: str | NotGiven = NOT_GIVEN,
197197
precedence: int | NotGiven = NOT_GIVEN,
198198
rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN,
199-
schedule: ScheduleParam | NotGiven = NOT_GIVEN,
199+
schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN,
200200
traffic: str | NotGiven = NOT_GIVEN,
201201
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
202202
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -495,12 +495,12 @@ async def create(
495495
description: str | NotGiven = NOT_GIVEN,
496496
device_posture: str | NotGiven = NOT_GIVEN,
497497
enabled: bool | NotGiven = NOT_GIVEN,
498-
expiration: rule_create_params.Expiration | NotGiven = NOT_GIVEN,
498+
expiration: Optional[rule_create_params.Expiration] | NotGiven = NOT_GIVEN,
499499
filters: List[GatewayFilter] | NotGiven = NOT_GIVEN,
500500
identity: str | NotGiven = NOT_GIVEN,
501501
precedence: int | NotGiven = NOT_GIVEN,
502502
rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN,
503-
schedule: ScheduleParam | NotGiven = NOT_GIVEN,
503+
schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN,
504504
traffic: str | NotGiven = NOT_GIVEN,
505505
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
506506
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -611,12 +611,12 @@ async def update(
611611
description: str | NotGiven = NOT_GIVEN,
612612
device_posture: str | NotGiven = NOT_GIVEN,
613613
enabled: bool | NotGiven = NOT_GIVEN,
614-
expiration: rule_update_params.Expiration | NotGiven = NOT_GIVEN,
614+
expiration: Optional[rule_update_params.Expiration] | NotGiven = NOT_GIVEN,
615615
filters: List[GatewayFilter] | NotGiven = NOT_GIVEN,
616616
identity: str | NotGiven = NOT_GIVEN,
617617
precedence: int | NotGiven = NOT_GIVEN,
618618
rule_settings: RuleSettingParam | NotGiven = NOT_GIVEN,
619-
schedule: ScheduleParam | NotGiven = NOT_GIVEN,
619+
schedule: Optional[ScheduleParam] | NotGiven = NOT_GIVEN,
620620
traffic: str | NotGiven = NOT_GIVEN,
621621
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
622622
# The extra values given here take precedence over values defined on the client or passed to this method.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import TypedDict
67

78
from .notification_settings_param import NotificationSettingsParam
@@ -19,7 +20,7 @@ class AntiVirusSettingsParam(TypedDict, total=False):
1920
fail_closed: bool
2021
"""Block requests for files that cannot be scanned."""
2122

22-
notification_settings: NotificationSettingsParam
23+
notification_settings: Optional[NotificationSettingsParam]
2324
"""
2425
Configure a message to display on the user's device when an antivirus search is
2526
performed.

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Literal, Required, TypedDict
67

78
from .tls_settings_param import TLSSettingsParam
@@ -36,28 +37,28 @@ class Sandbox(TypedDict, total=False):
3637

3738

3839
class GatewayConfigurationSettingsParam(TypedDict, total=False):
39-
activity_log: ActivityLogSettingsParam
40+
activity_log: Optional[ActivityLogSettingsParam]
4041
"""Activity log settings."""
4142

4243
antivirus: AntiVirusSettingsParam
4344
"""Anti-virus settings."""
4445

45-
block_page: BlockPageSettingsParam
46+
block_page: Optional[BlockPageSettingsParam]
4647
"""Block page layout settings."""
4748

48-
body_scanning: BodyScanningSettingsParam
49+
body_scanning: Optional[BodyScanningSettingsParam]
4950
"""DLP body scanning settings."""
5051

51-
browser_isolation: BrowserIsolationSettingsParam
52+
browser_isolation: Optional[BrowserIsolationSettingsParam]
5253
"""Browser isolation settings."""
5354

54-
certificate: Certificate
55+
certificate: Optional[Certificate]
5556
"""Certificate settings for Gateway TLS interception.
5657
5758
If not specified, the Cloudflare Root CA will be used.
5859
"""
5960

60-
custom_certificate: CustomCertificateSettingsParam
61+
custom_certificate: Optional[CustomCertificateSettingsParam]
6162
"""Custom certificate settings for BYO-PKI.
6263
6364
(deprecated and replaced by `certificate`)
@@ -66,14 +67,14 @@ class GatewayConfigurationSettingsParam(TypedDict, total=False):
6667
extended_email_matching: ExtendedEmailMatchingParam
6768
"""Extended e-mail matching settings."""
6869

69-
fips: FipsSettingsParam
70+
fips: Optional[FipsSettingsParam]
7071
"""FIPS settings."""
7172

72-
protocol_detection: ProtocolDetectionParam
73+
protocol_detection: Optional[ProtocolDetectionParam]
7374
"""Protocol Detection settings."""
7475

75-
sandbox: Sandbox
76+
sandbox: Optional[Sandbox]
7677
"""Sandbox settings."""
7778

78-
tls_decrypt: TLSSettingsParam
79+
tls_decrypt: Optional[TLSSettingsParam]
7980
"""TLS interception settings."""

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union
5+
from typing import List, Union, Optional
66
from datetime import datetime
77
from typing_extensions import Literal, Required, Annotated, TypedDict
88

@@ -54,7 +54,7 @@ class RuleCreateParams(TypedDict, total=False):
5454
enabled: bool
5555
"""True if the rule is enabled."""
5656

57-
expiration: Expiration
57+
expiration: Optional[Expiration]
5858
"""The expiration time stamp and default duration of a DNS policy.
5959
6060
Takes precedence over the policy's `schedule` configuration, if any.
@@ -81,7 +81,7 @@ class RuleCreateParams(TypedDict, total=False):
8181
rule_settings: RuleSettingParam
8282
"""Additional settings that modify the rule's action."""
8383

84-
schedule: ScheduleParam
84+
schedule: Optional[ScheduleParam]
8585
"""The schedule for activating DNS policies.
8686
8787
This does not apply to HTTP or network policies.

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

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

88
from .dns_resolver_settings_v4_param import DNSResolverSettingsV4Param
@@ -200,22 +200,22 @@ class UntrustedCERT(TypedDict, total=False):
200200

201201

202202
class RuleSettingParam(TypedDict, total=False):
203-
add_headers: Dict[str, str]
203+
add_headers: Optional[Dict[str, str]]
204204
"""Add custom headers to allowed requests, in the form of key-value pairs.
205205
206206
Keys are header names, pointing to an array with its header value(s).
207207
"""
208208

209-
allow_child_bypass: bool
209+
allow_child_bypass: Optional[bool]
210210
"""Set by parent MSP accounts to enable their children to bypass this rule."""
211211

212-
audit_ssh: AuditSSH
212+
audit_ssh: Optional[AuditSSH]
213213
"""Settings for the Audit SSH action."""
214214

215-
biso_admin_controls: BISOAdminControls
215+
biso_admin_controls: Optional[BISOAdminControls]
216216
"""Configure how browser isolation behaves."""
217217

218-
block_page: BlockPage
218+
block_page: Optional[BlockPage]
219219
"""Custom block page settings.
220220
221221
If missing/null, blocking will use the the account settings.
@@ -230,21 +230,21 @@ class RuleSettingParam(TypedDict, total=False):
230230
(if enabled).
231231
"""
232232

233-
bypass_parent_rule: bool
233+
bypass_parent_rule: Optional[bool]
234234
"""Set by children MSP accounts to bypass their parent's rules."""
235235

236-
check_session: CheckSession
236+
check_session: Optional[CheckSession]
237237
"""Configure how session check behaves."""
238238

239-
dns_resolvers: DNSResolvers
239+
dns_resolvers: Optional[DNSResolvers]
240240
"""Add your own custom resolvers to route queries that match the resolver policy.
241241
242242
Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally'
243243
are set. DNS queries will route to the address closest to their origin. Only
244244
valid when a rule's action is set to 'resolve'.
245245
"""
246246

247-
egress: Egress
247+
egress: Optional[Egress]
248248
"""Configure how Gateway Proxy traffic egresses.
249249
250250
You can enable this setting for rules with Egress actions and filters, or omit
@@ -273,10 +273,10 @@ class RuleSettingParam(TypedDict, total=False):
273273
By default indicator feeds only block based on domain names.
274274
"""
275275

276-
l4override: L4override
276+
l4override: Optional[L4override]
277277
"""Send matching traffic to the supplied destination IP address and port."""
278278

279-
notification_settings: NotificationSettings
279+
notification_settings: Optional[NotificationSettings]
280280
"""
281281
Configure a notification to display on the user's device when this rule is
282282
matched.
@@ -285,19 +285,19 @@ class RuleSettingParam(TypedDict, total=False):
285285
override_host: str
286286
"""Override matching DNS queries with a hostname."""
287287

288-
override_ips: List[str]
288+
override_ips: Optional[List[str]]
289289
"""Override matching DNS queries with an IP or set of IPs."""
290290

291-
payload_log: PayloadLog
291+
payload_log: Optional[PayloadLog]
292292
"""Configure DLP payload logging."""
293293

294-
quarantine: Quarantine
294+
quarantine: Optional[Quarantine]
295295
"""Settings that apply to quarantine rules"""
296296

297-
redirect: Redirect
297+
redirect: Optional[Redirect]
298298
"""Settings that apply to redirect rules"""
299299

300-
resolve_dns_internally: ResolveDNSInternally
300+
resolve_dns_internally: Optional[ResolveDNSInternally]
301301
"""
302302
Configure to forward the query to the internal DNS service, passing the
303303
specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified
@@ -313,5 +313,5 @@ class RuleSettingParam(TypedDict, total=False):
313313
'resolve'.
314314
"""
315315

316-
untrusted_cert: UntrustedCERT
316+
untrusted_cert: Optional[UntrustedCERT]
317317
"""Configure behavior when an upstream cert is invalid or an SSL error occurs."""

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Union
5+
from typing import List, Union, Optional
66
from datetime import datetime
77
from typing_extensions import Literal, Required, Annotated, TypedDict
88

@@ -54,7 +54,7 @@ class RuleUpdateParams(TypedDict, total=False):
5454
enabled: bool
5555
"""True if the rule is enabled."""
5656

57-
expiration: Expiration
57+
expiration: Optional[Expiration]
5858
"""The expiration time stamp and default duration of a DNS policy.
5959
6060
Takes precedence over the policy's `schedule` configuration, if any.
@@ -81,7 +81,7 @@ class RuleUpdateParams(TypedDict, total=False):
8181
rule_settings: RuleSettingParam
8282
"""Additional settings that modify the rule's action."""
8383

84-
schedule: ScheduleParam
84+
schedule: Optional[ScheduleParam]
8585
"""The schedule for activating DNS policies.
8686
8787
This does not apply to HTTP or network policies.

0 commit comments

Comments
 (0)
0